From: Subrata <sub...@us...> - 2008-03-14 16:05:10
|
Update of /cvsroot/ltp/ltp/testcases/realtime/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7072/ltp/testcases/realtime/lib Modified Files: librttest.c libstats.c Log Message: In a lot of cases, we do not really care about the samples and histogram files and their associated gnuplot command files or do not want to save them for example on embedded platforms with limited or no storage. This patch disables generating those files by default and introduce a new parameter to the tests, namely '-s', for when we really want to. Signed-off-by: Sebastien Dugue <seb...@bu...> Index: libstats.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/realtime/lib/libstats.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libstats.c 22 Feb 2008 14:43:59 -0000 1.3 --- libstats.c 14 Mar 2008 16:04:55 -0000 1.4 *************** *** 45,48 **** --- 45,50 ---- #include <libstats.h> + int save_stats = 0; + /* static helper functions */ static int stats_record_compare(const void * a, const void * b) { *************** *** 300,303 **** --- 302,308 ---- stats_record_t *rec; + if (!save_stats) + return 0; + /* generate the filenames */ if (!asprintf(&datfile, "%s.dat", filename) < 0) { Index: librttest.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/realtime/lib/librttest.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** librttest.c 22 Feb 2008 14:43:59 -0000 1.3 --- librttest.c 14 Mar 2008 16:04:55 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- #include <librttest.h> + #include <libstats.h> #include <stdio.h> *************** *** 77,80 **** --- 78,82 ---- printf(" -p(0,1) 0:don't use pi mutexes, 1:use pi mutexes\n"); printf(" -v[0-4] 0:no debug, 1:DBG_ERR, 2:DBG_WARN, 3:DBG_INFO, 4:DBG_DEBUG\n"); + printf(" -s Enable saving stats data (default disabled)\n"); } *************** *** 86,90 **** opterr = 0; char *all_options, *opt_ptr; ! static const char my_options[] = "b:p:v:"; if (options) { --- 88,92 ---- opterr = 0; char *all_options, *opt_ptr; ! static const char my_options[] = "b:p:v:s"; if (options) { *************** *** 118,121 **** --- 120,125 ---- _dbg_lvl = atoi(optarg); break; + case 's': + save_stats = 1; default: if (parse_arg) { |