summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
authorKan Liang2015-09-04 16:45:44 +0200
committerArnaldo Carvalho de Melo2015-09-14 17:50:31 +0200
commit21394d948a0c7c451d4a4d68afed9a06c4969636 (patch)
treed34f8d2a67e119e0f3b8b4586bf72223d75c5e96 /tools/perf/util/hist.c
parentperf tools: Introduce new sort type "socket" for the processor socket (diff)
downloadkernel-qcow2-linux-21394d948a0c7c451d4a4d68afed9a06c4969636.tar.gz
kernel-qcow2-linux-21394d948a0c7c451d4a4d68afed9a06c4969636.tar.xz
kernel-qcow2-linux-21394d948a0c7c451d4a4d68afed9a06c4969636.zip
perf report: Introduce --socket-filter option
Introduce --socket-filter option for 'perf report' to only show entries for a processor socket that match this filter. $ perf report --socket-filter 1 --stdio # To display the perf.data header info, please use --header/--header-only options. # # Total Lost Samples: 0 # # Samples: 752 of event 'cycles' # Event count (approx.): 350995599 # Processor Socket: 1 # # Overhead Command Shared Object Symbol # ........ ......... ................ ................................. # 97.02% test test [.] plusB_c 0.97% test test [.] plusA_c 0.23% swapper [kernel.vmlinux] [k] acpi_idle_do_entry 0.09% rcu_sched [kernel.vmlinux] [k] dyntick_save_progress_counter 0.01% swapper [kernel.vmlinux] [k] task_waking_fair 0.00% swapper [kernel.vmlinux] [k] run_timer_softirq Signed-off-by: Kan Liang <kan.liang@intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1441377946-44429-3-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index ba72a297676c..5d78ae879017 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -15,6 +15,8 @@ static bool hists__filter_entry_by_thread(struct hists *hists,
struct hist_entry *he);
static bool hists__filter_entry_by_symbol(struct hists *hists,
struct hist_entry *he);
+static bool hists__filter_entry_by_socket(struct hists *hists,
+ struct hist_entry *he);
u16 hists__col_len(struct hists *hists, enum hist_column col)
{
@@ -1027,6 +1029,7 @@ static void hists__apply_filters(struct hists *hists, struct hist_entry *he)
hists__filter_entry_by_dso(hists, he);
hists__filter_entry_by_thread(hists, he);
hists__filter_entry_by_symbol(hists, he);
+ hists__filter_entry_by_socket(hists, he);
}
void hists__collapse_resort(struct hists *hists, struct ui_progress *prog)
@@ -1295,6 +1298,18 @@ void hists__filter_by_symbol(struct hists *hists)
}
}
+static bool hists__filter_entry_by_socket(struct hists *hists,
+ struct hist_entry *he)
+{
+ if ((hists->socket_filter > -1) &&
+ (he->socket != hists->socket_filter)) {
+ he->filtered |= (1 << HIST_FILTER__SOCKET);
+ return true;
+ }
+
+ return false;
+}
+
void events_stats__inc(struct events_stats *stats, u32 type)
{
++stats->nr_events[0];
@@ -1520,6 +1535,7 @@ static int hists_evsel__init(struct perf_evsel *evsel)
hists->entries_collapsed = RB_ROOT;
hists->entries = RB_ROOT;
pthread_mutex_init(&hists->lock, NULL);
+ hists->socket_filter = -1;
return 0;
}