diff options
-rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index de76008fbaa2..78adc47da869 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -398,7 +398,7 @@ static void create_counter(int counter, int cpu, pid_t pid) | |||
398 | PERF_FORMAT_TOTAL_TIME_RUNNING | | 398 | PERF_FORMAT_TOTAL_TIME_RUNNING | |
399 | PERF_FORMAT_ID; | 399 | PERF_FORMAT_ID; |
400 | 400 | ||
401 | attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; | 401 | attr->sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID; |
402 | 402 | ||
403 | if (freq) { | 403 | if (freq) { |
404 | attr->sample_type |= PERF_SAMPLE_PERIOD; | 404 | attr->sample_type |= PERF_SAMPLE_PERIOD; |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 4858d83b3b67..044178408783 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -379,6 +379,7 @@ static int parse_tracepoint_event(const char **strp, | |||
379 | struct perf_counter_attr *attr) | 379 | struct perf_counter_attr *attr) |
380 | { | 380 | { |
381 | const char *evt_name; | 381 | const char *evt_name; |
382 | char *flags; | ||
382 | char sys_name[MAX_EVENT_LENGTH]; | 383 | char sys_name[MAX_EVENT_LENGTH]; |
383 | char id_buf[4]; | 384 | char id_buf[4]; |
384 | int fd; | 385 | int fd; |
@@ -400,6 +401,15 @@ static int parse_tracepoint_event(const char **strp, | |||
400 | strncpy(sys_name, *strp, sys_length); | 401 | strncpy(sys_name, *strp, sys_length); |
401 | sys_name[sys_length] = '\0'; | 402 | sys_name[sys_length] = '\0'; |
402 | evt_name = evt_name + 1; | 403 | evt_name = evt_name + 1; |
404 | |||
405 | flags = strchr(evt_name, ':'); | ||
406 | if (flags) { | ||
407 | *flags = '\0'; | ||
408 | flags++; | ||
409 | if (!strncmp(flags, "record", strlen(flags))) | ||
410 | attr->sample_type |= PERF_SAMPLE_RAW; | ||
411 | } | ||
412 | |||
403 | evt_length = strlen(evt_name); | 413 | evt_length = strlen(evt_name); |
404 | if (evt_length >= MAX_EVENT_LENGTH) | 414 | if (evt_length >= MAX_EVENT_LENGTH) |
405 | return 0; | 415 | return 0; |