Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175419
b: refs/heads/master
c: d1bde3f
h: refs/heads/master
i:
  175417: 1ed075f
  175415: 50e84a2
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Dec 9, 2009
1 parent 017326c commit 143d707
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9b495b0d35859971d6896293f6d0a0d880c7dfb
refs/heads/master: d1bde3f755e8652faad59e264c466c4baab68fa8
33 changes: 26 additions & 7 deletions trunk/tools/perf/builtin-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ static void parse_probe_event(const char *str)
pr_debug("%d arguments\n", pp->nr_args);
}

static void parse_probe_event_argv(int argc, const char **argv)
{
int i, len;
char *buf;

/* Bind up rest arguments */
len = 0;
for (i = 0; i < argc; i++)
len += strlen(argv[i]) + 1;
buf = zalloc(len + 1);
if (!buf)
die("Failed to allocate memory for binding arguments.");
len = 0;
for (i = 0; i < argc; i++)
len += sprintf(&buf[len], "%s ", argv[i]);
parse_probe_event(buf);
free(buf);
}

static int opt_add_probe_event(const struct option *opt __used,
const char *str, int unset __used)
{
Expand Down Expand Up @@ -160,16 +179,16 @@ static const struct option options[] = {

int cmd_probe(int argc, const char **argv, const char *prefix __used)
{
int i, j, ret;
int i, ret;
#ifndef NO_LIBDWARF
int fd;
#endif
struct probe_point *pp;

argc = parse_options(argc, argv, options, probe_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
for (i = 0; i < argc; i++)
parse_probe_event(argv[i]);
if (argc > 0)
parse_probe_event_argv(argc, argv);

if ((session.nr_probe == 0 && !listing) ||
(session.nr_probe != 0 && listing))
Expand Down Expand Up @@ -200,8 +219,8 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
}

/* Searching probe points */
for (j = 0; j < session.nr_probe; j++) {
pp = &session.probes[j];
for (i = 0; i < session.nr_probe; i++) {
pp = &session.probes[i];
if (pp->found)
continue;

Expand All @@ -223,8 +242,8 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
#endif /* !NO_LIBDWARF */

/* Synthesize probes without dwarf */
for (j = 0; j < session.nr_probe; j++) {
pp = &session.probes[j];
for (i = 0; i < session.nr_probe; i++) {
pp = &session.probes[i];
if (pp->found) /* This probe is already found. */
continue;

Expand Down

0 comments on commit 143d707

Please sign in to comment.