Skip to content

Commit

Permalink
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/acme/linux-2.6 into perf/urgent
  • Loading branch information
Ingo Molnar committed Mar 16, 2011
2 parents d109028 + 43adec9 commit 8b7cdd0
Show file tree
Hide file tree
Showing 24 changed files with 580 additions and 200 deletions.
26 changes: 26 additions & 0 deletions tools/perf/Documentation/perf-evlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
perf-evlist(1)
==============

NAME
----
perf-evlist - List the event names in a perf.data file

SYNOPSIS
--------
[verse]
'perf evlist <options>'

DESCRIPTION
-----------
This command displays the names of events sampled in a perf.data file.

OPTIONS
-------
-i::
--input=::
Input file name. (default: perf.data)

SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-list[1],
linkperf:perf-report[1]
22 changes: 22 additions & 0 deletions tools/perf/Documentation/perf-script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ OPTIONS
--debug-mode::
Do various checks like samples ordering and lost events.

-f::
--fields
Comma separated list of fields to print. Options are:
comm, tid, pid, time, cpu, event, trace, sym. Field
list must be prepended with the type, trace, sw or hw,
to indicate to which event type the field list applies.
e.g., -f sw:comm,tid,time,sym and -f trace:time,cpu,trace

-k::
--vmlinux=<file>::
vmlinux pathname

--kallsyms=<file>::
kallsyms pathname

--symfs=<directory>::
Look for files with symbols relative to this directory.

-G::
--hide-call-graph::
When printing symbols do not display call chain.

SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-script-perl[1],
Expand Down
1 change: 1 addition & 0 deletions tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ endif
BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o

BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
BUILTIN_OBJS += $(OUTPUT)builtin-help.o
BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
Expand Down
54 changes: 54 additions & 0 deletions tools/perf/builtin-evlist.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Builtin evlist command: Show the list of event selectors present
* in a perf.data file.
*/
#include "builtin.h"

#include "util/util.h"

#include <linux/list.h>

#include "perf.h"
#include "util/evlist.h"
#include "util/evsel.h"
#include "util/parse-events.h"
#include "util/parse-options.h"
#include "util/session.h"

static char const *input_name = "perf.data";

static int __cmd_evlist(void)
{
struct perf_session *session;
struct perf_evsel *pos;

session = perf_session__new(input_name, O_RDONLY, 0, false, NULL);
if (session == NULL)
return -ENOMEM;

list_for_each_entry(pos, &session->evlist->entries, node)
printf("%s\n", event_name(pos));

perf_session__delete(session);
return 0;
}

static const char * const evlist_usage[] = {
"perf evlist [<options>]",
NULL
};

static const struct option options[] = {
OPT_STRING('i', "input", &input_name, "file",
"input file name"),
OPT_END()
};

int cmd_evlist(int argc, const char **argv, const char *prefix __used)
{
argc = parse_options(argc, argv, options, evlist_usage, 0);
if (argc)
usage_with_options(evlist_usage, options);

return __cmd_evlist();
}
Loading

0 comments on commit 8b7cdd0

Please sign in to comment.