parse-events.c (3eb66e91a25497065c5322b1268cbc3953642227) | parse-events.c (714a92d83fd1e20461f53549cfbee77b20be5032) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include "tests.h" 7#include "debug.h" 8#include "util.h" --- 1316 unchanged lines hidden (view full) --- 1325static int test__checkevent_complex_name(struct perf_evlist *evlist) 1326{ 1327 struct perf_evsel *evsel = perf_evlist__first(evlist); 1328 1329 TEST_ASSERT_VAL("wrong complex name parsing", strcmp(evsel->name, "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks") == 0); 1330 return 0; 1331} 1332 | 1// SPDX-License-Identifier: GPL-2.0 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include "tests.h" 7#include "debug.h" 8#include "util.h" --- 1316 unchanged lines hidden (view full) --- 1325static int test__checkevent_complex_name(struct perf_evlist *evlist) 1326{ 1327 struct perf_evsel *evsel = perf_evlist__first(evlist); 1328 1329 TEST_ASSERT_VAL("wrong complex name parsing", strcmp(evsel->name, "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks") == 0); 1330 return 0; 1331} 1332 |
1333static int test__sym_event_slash(struct perf_evlist *evlist) 1334{ 1335 struct perf_evsel *evsel = perf_evlist__first(evlist); 1336 1337 TEST_ASSERT_VAL("wrong type", evsel->attr.type == PERF_TYPE_HARDWARE); 1338 TEST_ASSERT_VAL("wrong config", evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES); 1339 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); 1340 return 0; 1341} 1342 1343static int test__sym_event_dc(struct perf_evlist *evlist) 1344{ 1345 struct perf_evsel *evsel = perf_evlist__first(evlist); 1346 1347 TEST_ASSERT_VAL("wrong type", evsel->attr.type == PERF_TYPE_HARDWARE); 1348 TEST_ASSERT_VAL("wrong config", evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES); 1349 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); 1350 return 0; 1351} 1352 |
|
1333static int count_tracepoints(void) 1334{ 1335 struct dirent *events_ent; 1336 DIR *events_dir; 1337 int cnt = 0; 1338 1339 events_dir = tracing_events__opendir(); 1340 --- 324 unchanged lines hidden (view full) --- 1665 .valid = test__intel_pt_valid, 1666 .check = test__intel_pt, 1667 .id = 52, 1668 }, 1669 { 1670 .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", 1671 .check = test__checkevent_complex_name, 1672 .id = 53 | 1353static int count_tracepoints(void) 1354{ 1355 struct dirent *events_ent; 1356 DIR *events_dir; 1357 int cnt = 0; 1358 1359 events_dir = tracing_events__opendir(); 1360 --- 324 unchanged lines hidden (view full) --- 1685 .valid = test__intel_pt_valid, 1686 .check = test__intel_pt, 1687 .id = 52, 1688 }, 1689 { 1690 .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", 1691 .check = test__checkevent_complex_name, 1692 .id = 53 |
1693 }, 1694 { 1695 .name = "cycles//u", 1696 .check = test__sym_event_slash, 1697 .id = 54, 1698 }, 1699 { 1700 .name = "cycles:k", 1701 .check = test__sym_event_dc, 1702 .id = 55, |
|
1673 } 1674}; 1675 1676static struct evlist_test test__events_pmu[] = { 1677 { 1678 .name = "cpu/config=10,config1,config2=3,period=1000/u", 1679 .check = test__checkevent_pmu, 1680 .id = 0, --- 207 unchanged lines hidden --- | 1703 } 1704}; 1705 1706static struct evlist_test test__events_pmu[] = { 1707 { 1708 .name = "cpu/config=10,config1,config2=3,period=1000/u", 1709 .check = test__checkevent_pmu, 1710 .id = 0, --- 207 unchanged lines hidden --- |