Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223860
b: refs/heads/master
c: 4c635a4
h: refs/heads/master
v: v3
  • Loading branch information
Corey Ashford authored and Arnaldo Carvalho de Melo committed Dec 1, 2010
1 parent 1817c0c commit 27021e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: 3e8e24f2fc66d32eb0e570e4117dfd05227047e6
refs/heads/master: 4c635a4e04700a371ef7e4d4bb33ed88747e801e
12 changes: 8 additions & 4 deletions trunk/tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ parse_single_tracepoint_event(char *sys_name,
id = atoll(id_buf);
attr->config = id;
attr->type = PERF_TYPE_TRACEPOINT;
*strp = evt_name + evt_length;
*strp += strlen(sys_name) + evt_length + 1; /* + 1 for the ':' */

attr->sample_type |= PERF_SAMPLE_RAW;
attr->sample_type |= PERF_SAMPLE_TIME;
Expand Down Expand Up @@ -495,7 +495,7 @@ static enum event_result parse_tracepoint_event(const char **strp,
struct perf_event_attr *attr)
{
const char *evt_name;
char *flags;
char *flags = NULL, *comma_loc;
char sys_name[MAX_EVENT_LENGTH];
unsigned int sys_length, evt_length;

Expand All @@ -514,6 +514,11 @@ static enum event_result parse_tracepoint_event(const char **strp,
sys_name[sys_length] = '\0';
evt_name = evt_name + 1;

comma_loc = strchr(evt_name, ',');
if (comma_loc) {
/* take the event name up to the comma */
evt_name = strndup(evt_name, comma_loc - evt_name);
}
flags = strchr(evt_name, ':');
if (flags) {
/* split it out: */
Expand All @@ -524,9 +529,8 @@ static enum event_result parse_tracepoint_event(const char **strp,
evt_length = strlen(evt_name);
if (evt_length >= MAX_EVENT_LENGTH)
return EVT_FAILED;

if (strpbrk(evt_name, "*?")) {
*strp = evt_name + evt_length;
*strp += strlen(sys_name) + evt_length;
return parse_multiple_tracepoint_event(sys_name, evt_name,
flags);
} else
Expand Down

0 comments on commit 27021e1

Please sign in to comment.