[PATCH 2/7] perf timechart: add option to limit number of tasks

From: Stanislav Fomichev
Date: Fri Nov 01 2013 - 12:36:12 EST


Add -n option to specify min. number of tasks to print.

Signed-off-by: Stanislav Fomichev <stfomichev@xxxxxxxxxxxxxx>
---
tools/perf/Documentation/perf-timechart.txt | 4 ++++
tools/perf/builtin-timechart.c | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-timechart.txt b/tools/perf/Documentation/perf-timechart.txt
index 1632b0efc757..919cbe9ce428 100644
--- a/tools/perf/Documentation/perf-timechart.txt
+++ b/tools/perf/Documentation/perf-timechart.txt
@@ -41,6 +41,10 @@ OPTIONS
--symfs=<directory>::
Look for files with symbols relative to this directory.

+-n::
+--proc-num::
+ Print task info for at least given number of tasks.
+
SEE ALSO
--------
linkperf:perf-record[1]
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index c68ed44c2319..51a5532b3382 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -40,6 +40,7 @@
#define SUPPORT_OLD_POWER_EVENTS 1
#define PWR_EVENT_EXIT -1

+static int proc_num = 15;

static unsigned int numcpus;
static u64 min_freq; /* Lowest CPU frequency seen */
@@ -954,7 +955,7 @@ static void write_svg_file(const char *filename)
do {
count = determine_display_tasks(thresh);
thresh /= 10;
- } while (!process_filter && thresh && count < 15);
+ } while (!process_filter && thresh && count < proc_num);

open_svg(filename, numcpus, count, first_time, last_time);

@@ -1096,6 +1097,8 @@ int cmd_timechart(int argc, const char **argv,
parse_process),
OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
"Look for files with symbols relative to this directory"),
+ OPT_INTEGER('n', "proc-num", &proc_num,
+ "min. number of tasks to print"),
OPT_END()
};
const char * const timechart_usage[] = {
--
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/