parse-events.c (7ae383be81781c5e1347f71c3eb0d53ce5188200) | parse-events.c (43f322b4ab3f203d8eefbdad6e58e1637221e4a7) |
---|---|
1 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include <api/fs/tracefs.h> 7#include <api/fs/debugfs.h> 8#include "tests.h" --- 413 unchanged lines hidden (view full) --- 422 TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); 423 TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); 424 TEST_ASSERT_VAL("wrong config2", 0 == evsel->attr.config2); 425 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); 426 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 427 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); 428 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); 429 | 1 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include <api/fs/tracefs.h> 7#include <api/fs/debugfs.h> 8#include "tests.h" --- 413 unchanged lines hidden (view full) --- 422 TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); 423 TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); 424 TEST_ASSERT_VAL("wrong config2", 0 == evsel->attr.config2); 425 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); 426 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 427 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); 428 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); 429 |
430 /* syscalls:sys_enter_open:k */ | 430 /* syscalls:sys_enter_openat:k */ |
431 evsel = perf_evsel__next(evsel); 432 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); 433 TEST_ASSERT_VAL("wrong sample_type", 434 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); 435 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); 436 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); 437 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 438 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); --- 221 unchanged lines hidden (view full) --- 660 661static int test__group3(struct perf_evlist *evlist __maybe_unused) 662{ 663 struct perf_evsel *evsel, *leader; 664 665 TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->nr_entries); 666 TEST_ASSERT_VAL("wrong number of groups", 2 == evlist->nr_groups); 667 | 431 evsel = perf_evsel__next(evsel); 432 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); 433 TEST_ASSERT_VAL("wrong sample_type", 434 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); 435 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); 436 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); 437 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 438 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); --- 221 unchanged lines hidden (view full) --- 660 661static int test__group3(struct perf_evlist *evlist __maybe_unused) 662{ 663 struct perf_evsel *evsel, *leader; 664 665 TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->nr_entries); 666 TEST_ASSERT_VAL("wrong number of groups", 2 == evlist->nr_groups); 667 |
668 /* group1 syscalls:sys_enter_open:H */ | 668 /* group1 syscalls:sys_enter_openat:H */ |
669 evsel = leader = perf_evlist__first(evlist); 670 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); 671 TEST_ASSERT_VAL("wrong sample_type", 672 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); 673 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); 674 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); 675 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 676 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); --- 611 unchanged lines hidden (view full) --- 1288 const char *name; 1289 __u32 type; 1290 const int id; 1291 int (*check)(struct perf_evlist *evlist); 1292}; 1293 1294static struct evlist_test test__events[] = { 1295 { | 669 evsel = leader = perf_evlist__first(evlist); 670 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); 671 TEST_ASSERT_VAL("wrong sample_type", 672 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); 673 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); 674 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); 675 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); 676 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); --- 611 unchanged lines hidden (view full) --- 1288 const char *name; 1289 __u32 type; 1290 const int id; 1291 int (*check)(struct perf_evlist *evlist); 1292}; 1293 1294static struct evlist_test test__events[] = { 1295 { |
1296 .name = "syscalls:sys_enter_open", | 1296 .name = "syscalls:sys_enter_openat", |
1297 .check = test__checkevent_tracepoint, 1298 .id = 0, 1299 }, 1300 { 1301 .name = "syscalls:*", 1302 .check = test__checkevent_tracepoint_multi, 1303 .id = 1, 1304 }, --- 43 unchanged lines hidden (view full) --- 1348 .id = 10, 1349 }, 1350 { 1351 .name = "mem:0:w", 1352 .check = test__checkevent_breakpoint_w, 1353 .id = 11, 1354 }, 1355 { | 1297 .check = test__checkevent_tracepoint, 1298 .id = 0, 1299 }, 1300 { 1301 .name = "syscalls:*", 1302 .check = test__checkevent_tracepoint_multi, 1303 .id = 1, 1304 }, --- 43 unchanged lines hidden (view full) --- 1348 .id = 10, 1349 }, 1350 { 1351 .name = "mem:0:w", 1352 .check = test__checkevent_breakpoint_w, 1353 .id = 11, 1354 }, 1355 { |
1356 .name = "syscalls:sys_enter_open:k", | 1356 .name = "syscalls:sys_enter_openat:k", |
1357 .check = test__checkevent_tracepoint_modifier, 1358 .id = 12, 1359 }, 1360 { 1361 .name = "syscalls:*:u", 1362 .check = test__checkevent_tracepoint_multi_modifier, 1363 .id = 13, 1364 }, --- 38 unchanged lines hidden (view full) --- 1403 .id = 21, 1404 }, 1405 { 1406 .name = "mem:0:w:up", 1407 .check = test__checkevent_breakpoint_w_modifier, 1408 .id = 22, 1409 }, 1410 { | 1357 .check = test__checkevent_tracepoint_modifier, 1358 .id = 12, 1359 }, 1360 { 1361 .name = "syscalls:*:u", 1362 .check = test__checkevent_tracepoint_multi_modifier, 1363 .id = 13, 1364 }, --- 38 unchanged lines hidden (view full) --- 1403 .id = 21, 1404 }, 1405 { 1406 .name = "mem:0:w:up", 1407 .check = test__checkevent_breakpoint_w_modifier, 1408 .id = 22, 1409 }, 1410 { |
1411 .name = "r1,syscalls:sys_enter_open:k,1:1:hp", | 1411 .name = "r1,syscalls:sys_enter_openat:k,1:1:hp", |
1412 .check = test__checkevent_list, 1413 .id = 23, 1414 }, 1415 { 1416 .name = "instructions:G", 1417 .check = test__checkevent_exclude_host_modifier, 1418 .id = 24, 1419 }, --- 18 unchanged lines hidden (view full) --- 1438 .id = 28, 1439 }, 1440 { 1441 .name = "{faults:k,cache-references}:u,cycles:k", 1442 .check = test__group2, 1443 .id = 29, 1444 }, 1445 { | 1412 .check = test__checkevent_list, 1413 .id = 23, 1414 }, 1415 { 1416 .name = "instructions:G", 1417 .check = test__checkevent_exclude_host_modifier, 1418 .id = 24, 1419 }, --- 18 unchanged lines hidden (view full) --- 1438 .id = 28, 1439 }, 1440 { 1441 .name = "{faults:k,cache-references}:u,cycles:k", 1442 .check = test__group2, 1443 .id = 29, 1444 }, 1445 { |
1446 .name = "group1{syscalls:sys_enter_open:H,cycles:kppp},group2{cycles,1:3}:G,instructions:u", | 1446 .name = "group1{syscalls:sys_enter_openat:H,cycles:kppp},group2{cycles,1:3}:G,instructions:u", |
1447 .check = test__group3, 1448 .id = 30, 1449 }, 1450 { 1451 .name = "{cycles:u,instructions:kp}:p", 1452 .check = test__group4, 1453 .id = 31, 1454 }, --- 111 unchanged lines hidden (view full) --- 1566{ 1567 struct perf_evlist *evlist; 1568 int ret; 1569 1570 evlist = perf_evlist__new(); 1571 if (evlist == NULL) 1572 return -ENOMEM; 1573 | 1447 .check = test__group3, 1448 .id = 30, 1449 }, 1450 { 1451 .name = "{cycles:u,instructions:kp}:p", 1452 .check = test__group4, 1453 .id = 31, 1454 }, --- 111 unchanged lines hidden (view full) --- 1566{ 1567 struct perf_evlist *evlist; 1568 int ret; 1569 1570 evlist = perf_evlist__new(); 1571 if (evlist == NULL) 1572 return -ENOMEM; 1573 |
1574 ret = parse_events(evlist, e->name); | 1574 ret = parse_events(evlist, e->name, NULL); |
1575 if (ret) { 1576 pr_debug("failed to parse event '%s', err %d\n", 1577 e->name, ret); 1578 } else { 1579 ret = e->check(evlist); 1580 } 1581 1582 perf_evlist__delete(evlist); --- 152 unchanged lines hidden --- | 1575 if (ret) { 1576 pr_debug("failed to parse event '%s', err %d\n", 1577 e->name, ret); 1578 } else { 1579 ret = e->check(evlist); 1580 } 1581 1582 perf_evlist__delete(evlist); --- 152 unchanged lines hidden --- |