diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-05 10:22:45 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-05 10:22:45 -0400 |
commit | 593d0a3e9f813db910dc50574532914db21d09ff (patch) | |
tree | 12d8413ee57b4383ca8c906996ffe02be6d377a5 /tools/perf/util/scripting-engines/trace-event-perl.c | |
parent | 50e900417b8096939d12a46848f965e27a905e36 (diff) | |
parent | 4cb38750d49010ae72e718d46605ac9ba5a851b4 (diff) |
Merge commit '4cb38750d49010ae72e718d46605ac9ba5a851b4' into stable/for-linus-3.6
* commit '4cb38750d49010ae72e718d46605ac9ba5a851b4': (6849 commits)
bcma: fix invalid PMU chip control masks
[libata] pata_cmd64x: whitespace cleanup
libata-acpi: fix up for acpi_pm_device_sleep_state API
sata_dwc_460ex: device tree may specify dma_channel
ahci, trivial: fixed coding style issues related to braces
ahci_platform: add hibernation callbacks
libata-eh.c: local functions should not be exposed globally
libata-transport.c: local functions should not be exposed globally
sata_dwc_460ex: support hardreset
ata: use module_pci_driver
drivers/ata/pata_pcmcia.c: adjust suspicious bit operation
pata_imx: Convert to clk_prepare_enable/clk_disable_unprepare
ahci: Enable SB600 64bit DMA on MSI K9AGM2 (MS-7327) v2
[libata] Prevent interface errors with Seagate FreeAgent GoFlex
drivers/acpi/glue: revert accidental license-related 6b66d95895c bits
libata-acpi: add missing inlines in libata.h
i2c-omap: Add support for I2C_M_STOP message flag
i2c: Fall back to emulated SMBus if the operation isn't supported natively
i2c: Add SCCB support
i2c-tiny-usb: Add support for the Robofuzz OSIF USB/I2C converter
...
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-perl.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index 4c1b3d72a1d2..02dfa19a467f 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c | |||
@@ -209,6 +209,10 @@ static void define_event_symbols(struct event_format *event, | |||
209 | define_symbolic_values(args->symbol.symbols, ev_name, | 209 | define_symbolic_values(args->symbol.symbols, ev_name, |
210 | cur_field_name); | 210 | cur_field_name); |
211 | break; | 211 | break; |
212 | case PRINT_HEX: | ||
213 | define_event_symbols(event, ev_name, args->hex.field); | ||
214 | define_event_symbols(event, ev_name, args->hex.size); | ||
215 | break; | ||
212 | case PRINT_BSTRING: | 216 | case PRINT_BSTRING: |
213 | case PRINT_DYNAMIC_ARRAY: | 217 | case PRINT_DYNAMIC_ARRAY: |
214 | case PRINT_STRING: | 218 | case PRINT_STRING: |
@@ -233,7 +237,8 @@ static void define_event_symbols(struct event_format *event, | |||
233 | define_event_symbols(event, ev_name, args->next); | 237 | define_event_symbols(event, ev_name, args->next); |
234 | } | 238 | } |
235 | 239 | ||
236 | static inline struct event_format *find_cache_event(int type) | 240 | static inline |
241 | struct event_format *find_cache_event(struct pevent *pevent, int type) | ||
237 | { | 242 | { |
238 | static char ev_name[256]; | 243 | static char ev_name[256]; |
239 | struct event_format *event; | 244 | struct event_format *event; |
@@ -241,7 +246,7 @@ static inline struct event_format *find_cache_event(int type) | |||
241 | if (events[type]) | 246 | if (events[type]) |
242 | return events[type]; | 247 | return events[type]; |
243 | 248 | ||
244 | events[type] = event = trace_find_event(type); | 249 | events[type] = event = pevent_find_event(pevent, type); |
245 | if (!event) | 250 | if (!event) |
246 | return NULL; | 251 | return NULL; |
247 | 252 | ||
@@ -252,7 +257,8 @@ static inline struct event_format *find_cache_event(int type) | |||
252 | return event; | 257 | return event; |
253 | } | 258 | } |
254 | 259 | ||
255 | static void perl_process_tracepoint(union perf_event *pevent __unused, | 260 | static void perl_process_tracepoint(union perf_event *perf_event __unused, |
261 | struct pevent *pevent, | ||
256 | struct perf_sample *sample, | 262 | struct perf_sample *sample, |
257 | struct perf_evsel *evsel, | 263 | struct perf_evsel *evsel, |
258 | struct machine *machine __unused, | 264 | struct machine *machine __unused, |
@@ -275,13 +281,13 @@ static void perl_process_tracepoint(union perf_event *pevent __unused, | |||
275 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 281 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) |
276 | return; | 282 | return; |
277 | 283 | ||
278 | type = trace_parse_common_type(data); | 284 | type = trace_parse_common_type(pevent, data); |
279 | 285 | ||
280 | event = find_cache_event(type); | 286 | event = find_cache_event(pevent, type); |
281 | if (!event) | 287 | if (!event) |
282 | die("ug! no event found for type %d", type); | 288 | die("ug! no event found for type %d", type); |
283 | 289 | ||
284 | pid = trace_parse_common_pid(data); | 290 | pid = trace_parse_common_pid(pevent, data); |
285 | 291 | ||
286 | sprintf(handler, "%s::%s", event->system, event->name); | 292 | sprintf(handler, "%s::%s", event->system, event->name); |
287 | 293 | ||
@@ -314,7 +320,8 @@ static void perl_process_tracepoint(union perf_event *pevent __unused, | |||
314 | offset = field->offset; | 320 | offset = field->offset; |
315 | XPUSHs(sv_2mortal(newSVpv((char *)data + offset, 0))); | 321 | XPUSHs(sv_2mortal(newSVpv((char *)data + offset, 0))); |
316 | } else { /* FIELD_IS_NUMERIC */ | 322 | } else { /* FIELD_IS_NUMERIC */ |
317 | val = read_size(data + field->offset, field->size); | 323 | val = read_size(pevent, data + field->offset, |
324 | field->size); | ||
318 | if (field->flags & FIELD_IS_SIGNED) { | 325 | if (field->flags & FIELD_IS_SIGNED) { |
319 | XPUSHs(sv_2mortal(newSViv(val))); | 326 | XPUSHs(sv_2mortal(newSViv(val))); |
320 | } else { | 327 | } else { |
@@ -368,14 +375,15 @@ static void perl_process_event_generic(union perf_event *pevent __unused, | |||
368 | LEAVE; | 375 | LEAVE; |
369 | } | 376 | } |
370 | 377 | ||
371 | static void perl_process_event(union perf_event *pevent, | 378 | static void perl_process_event(union perf_event *event, |
379 | struct pevent *pevent, | ||
372 | struct perf_sample *sample, | 380 | struct perf_sample *sample, |
373 | struct perf_evsel *evsel, | 381 | struct perf_evsel *evsel, |
374 | struct machine *machine, | 382 | struct machine *machine, |
375 | struct thread *thread) | 383 | struct thread *thread) |
376 | { | 384 | { |
377 | perl_process_tracepoint(pevent, sample, evsel, machine, thread); | 385 | perl_process_tracepoint(event, pevent, sample, evsel, machine, thread); |
378 | perl_process_event_generic(pevent, sample, evsel, machine, thread); | 386 | perl_process_event_generic(event, sample, evsel, machine, thread); |
379 | } | 387 | } |
380 | 388 | ||
381 | static void run_start_sub(void) | 389 | static void run_start_sub(void) |
@@ -448,7 +456,7 @@ static int perl_stop_script(void) | |||
448 | return 0; | 456 | return 0; |
449 | } | 457 | } |
450 | 458 | ||
451 | static int perl_generate_script(const char *outfile) | 459 | static int perl_generate_script(struct pevent *pevent, const char *outfile) |
452 | { | 460 | { |
453 | struct event_format *event = NULL; | 461 | struct event_format *event = NULL; |
454 | struct format_field *f; | 462 | struct format_field *f; |
@@ -495,7 +503,7 @@ static int perl_generate_script(const char *outfile) | |||
495 | fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n"); | 503 | fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n"); |
496 | fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n\n"); | 504 | fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n\n"); |
497 | 505 | ||
498 | while ((event = trace_find_next_event(event))) { | 506 | while ((event = trace_find_next_event(pevent, event))) { |
499 | fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name); | 507 | fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name); |
500 | fprintf(ofp, "\tmy ("); | 508 | fprintf(ofp, "\tmy ("); |
501 | 509 | ||