Arnaldo Carvalho de Melo
602a1f4daa
perf tools: Rename strlist_for_each() macros to for_each_entry()
...
To match the semantics for list.h in the kernel, that are the
interface we use in them.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Milian Wolff <milian.wolff@kdab.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Taeung Song <treeze.taeung@gmail.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-0b5i2ki9c3di6706fxpticsb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-06-23 11:35:01 -03:00
Namhyung Kim
dd8232bc9d
perf tools: Add file_only config option to strlist
...
If strlist_config.dirname is present, the strlist__new() tries to load
stirngs from dirname/list file first but if it failes it falls back to
add 'list' as string. But sometimes it's not desired so adds new
file_only field to prevent it.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
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: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1452334589-8782-2-git-send-email-namhyung@kernel.org
[ Add documentation for strlist_config::file_only, in the struct definition */
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-01-12 12:42:07 -03:00
Arnaldo Carvalho de Melo
8816d38d49
perf strlist: Make parse_list() private
...
It is not used anywhere, expose it when/if needed.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-f6in51stj17avhk4rv11gjgg@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-07-20 14:51:07 -03:00
Arnaldo Carvalho de Melo
8ff9daf3c1
perf strlist: Allow substitutions from file contents in a given directory
...
So, if we have an strlist equal to:
"file,close"
And we call it as:
struct strlist_config *config = { .dirname = "~/strace/groups", };
struct strlist *slist = strlist__new("file, close", &config);
And we have:
$ cat ~/strace/groups/file
access
open
openat
statfs
Then the resulting strlist will have these contents:
[ "access", "open", "openat", "statfs", "close" ]
This will be used to implement strace syscall groups in 'perf trace',
but can be used in some other tool, thus being implemented in 'strlist'.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-wi6l6qtomqlywwr6005jvs05@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-07-20 14:44:59 -03:00
Arnaldo Carvalho de Melo
4a77e2183f
perf strlist: Make dupstr be the default and part of an extensible config parm
...
So that we can pass more info to strlist__new() without having to change
its function signature, just adding entries to the strlist_config struct
with sensible defaults for when those fields are not specified.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-5uaaler4931i0s9sedxjquhq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-07-20 12:13:34 -03:00
Arnaldo Carvalho de Melo
d8639f068a
perf tools: Stop using 'self' in strlist
...
As suggested by tglx, 'self' should be replaced by something that is
more useful.
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-933537sxtcz47qs0e0ledmrp@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-25 12:49:28 -03:00
David Ahern
ee8dd3ca43
perf tools: Change strlist to use the new rblist
...
Replaces the direct use of rbtree code with the rblist API. In the end
the patch is a no-op on strlist functionality; the API for strlist is
not changed, only its implementaton.
Signed-off-by: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/1343709095-7089-3-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-08-03 10:39:51 -03:00
Masami Hiramatsu
abf5ef7247
perf tools: Add for_each macros for strlist
...
Add for_each iteration macros for strlist. This patch
introduces strlist__for_each() and strlist__for_each_safe(),
both are similar to list_for_each() and list_for_each_safe().
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Jim Keniston <jkenisto@us.ibm.com >
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com >
Cc: Christoph Hellwig <hch@infradead.org >
Cc: Frank Ch. Eigler <fche@redhat.com >
Cc: Jason Baron <jbaron@redhat.com >
Cc: K.Prasad <prasad@linux.vnet.ibm.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Cc: systemtap <systemtap@sources.redhat.com >
Cc: DLE <dle-develop@lists.sourceforge.net >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
LKML-Reference: <20091215153156.17436.49157.stgit@dhcp-100-2-132.bos.redhat.com >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-12-15 20:22:02 +01:00
Masami Hiramatsu
3e3405906d
perf probe: Fix --del to update current event list
...
Fix --del option to update current existing event list
after perf probe deleted an event.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Jim Keniston <jkenisto@us.ibm.com >
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com >
Cc: Christoph Hellwig <hch@infradead.org >
Cc: Frank Ch. Eigler <fche@redhat.com >
Cc: Jason Baron <jbaron@redhat.com >
Cc: K.Prasad <prasad@linux.vnet.ibm.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Cc: systemtap <systemtap@sources.redhat.com >
Cc: DLE <dle-develop@lists.sourceforge.net >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
LKML-Reference: <20091215153149.17436.61265.stgit@dhcp-100-2-132.bos.redhat.com >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-12-15 20:22:01 +01:00
John Kacur
8b40f521cf
perf tools: Protect header files with a consistent style
...
There was a colorful mix of header guards - standardize them.
Signed-off-by: John Kacur <jkacur@redhat.com >
LKML-Reference: <alpine.LFD.2.00.0909241756530.11383@localhost.localdomain >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-09-24 21:27:51 +02:00
Arnaldo Carvalho de Melo
27d0fd410c
strlist: Introduce strlist__entry and strlist__nr_entries methods
...
The strlist__entry method allows accessing strlists like an
array, will be used in the 'perf report' to access the first
entry.
We now keep the nr_entries so that we can check if we have just
one entry, will be used in 'perf report' to improve the output
by showing just at the top when we have just, say, one DSO.
While at it use nr_entries to optimize strlist__is_empty by not
using the far more costly rb_first based implementation.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
LKML-Reference: <1247325517-12272-2-git-send-email-acme@redhat.com >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-07-11 19:20:25 +02:00
Arnaldo Carvalho de Melo
43cbcd8acb
perf_counter tools: Share rbtree.with the kernel
...
The tools/perf/util/rbtree.c copy already drifted by three
csets:
4b324126e0
4c60117811
16c047add3
So remove the copy and use the lib/rbtree.c directly, sharing
the source code while still generating a separate object file,
since tools/perf uses a far more agressive -O6 switch.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
LKML-Reference: <20090701152837.GG15682@ghostprotocols.net >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-07-01 22:37:22 +02:00
Arnaldo Carvalho de Melo
25903407da
perf report: Add --dsos parameter
...
So that we can filter by dso. Symbols in other dsos won't be
accounted for.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Paul Mackerras <paulus@samba.org >
LKML-Reference: <1246399282-20934-2-git-send-email-acme@redhat.com >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2009-07-01 00:07:09 +02:00