perf sort: Provide a way to find out if per-thread bucketing is in place
authorNamhyung Kim <namhyung@kernel.org>
Thu, 21 Jan 2016 22:13:24 +0000 (19:13 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 26 Jan 2016 14:52:49 +0000 (11:52 -0300)
Now the UI browsers will be able to offer thread related operations only
if the thread is part of the sort order in use, i.e. if hist_entry stats
are all for a single thread.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1452960197-5323-9-git-send-email-namhyung@kernel.org
[ Carved out from a  larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/sort.c
tools/perf/util/sort.h

index ec722346e6ffb8dd6531e94576bb15b548a1487b..898e4b0724bf1a020fb89796b374fe3630848516 100644 (file)
@@ -25,6 +25,7 @@ int           sort__has_parent = 0;
 int            sort__has_sym = 0;
 int            sort__has_dso = 0;
 int            sort__has_socket = 0;
+int            sort__has_thread = 0;
 enum sort_mode sort__mode = SORT_MODE__NORMAL;
 
 
@@ -2136,6 +2137,8 @@ static int sort_dimension__add(const char *tok,
                        sort__has_dso = 1;
                } else if (sd->entry == &sort_socket) {
                        sort__has_socket = 1;
+               } else if (sd->entry == &sort_thread) {
+                       sort__has_thread = 1;
                }
 
                return __sort_dimension__add(sd);
index 687bbb1244281ba65a99c3cb78f5bcb8a1eaa41b..09616f03d412a044df419ff73d9ed824baa0ff0b 100644 (file)
@@ -35,6 +35,7 @@ extern int sort__need_collapse;
 extern int sort__has_parent;
 extern int sort__has_sym;
 extern int sort__has_socket;
+extern int sort__has_thread;
 extern enum sort_mode sort__mode;
 extern struct sort_entry sort_comm;
 extern struct sort_entry sort_dso;