parse-events.c (fe7a2eaa71c55aadbf95d01d32df8dccc0db0646) parse-events.c (10bf358a1b79fa1311eb05ee31f2cefdcad01741)
1
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"

--- 1257 unchanged lines hidden (view full) ---

1266
1267 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
1268 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type);
1269 TEST_ASSERT_VAL("wrong config",
1270 PERF_COUNT_SW_TASK_CLOCK == evsel->attr.config);
1271 return 0;
1272}
1273
1
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"

--- 1257 unchanged lines hidden (view full) ---

1266
1267 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
1268 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type);
1269 TEST_ASSERT_VAL("wrong config",
1270 PERF_COUNT_SW_TASK_CLOCK == evsel->attr.config);
1271 return 0;
1272}
1273
1274static int test__checkevent_config_symbol(struct perf_evlist *evlist)
1275{
1276 struct perf_evsel *evsel = perf_evlist__first(evlist);
1277
1278 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "insn") == 0);
1279 return 0;
1280}
1281
1282static int test__checkevent_config_raw(struct perf_evlist *evlist)
1283{
1284 struct perf_evsel *evsel = perf_evlist__first(evlist);
1285
1286 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "rawpmu") == 0);
1287 return 0;
1288}
1289
1290static int test__checkevent_config_num(struct perf_evlist *evlist)
1291{
1292 struct perf_evsel *evsel = perf_evlist__first(evlist);
1293
1294 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "numpmu") == 0);
1295 return 0;
1296}
1297
1298
1274static int count_tracepoints(void)
1275{
1276 struct dirent *events_ent;
1277 DIR *events_dir;
1278 int cnt = 0;
1279
1280 events_dir = opendir(tracing_events_path);
1281

--- 292 unchanged lines hidden (view full) ---

1574 .check = test__checkevent_exclude_idle_modifier_1,
1575 .id = 46,
1576 },
1577 {
1578 .name = "task-clock:P,cycles",
1579 .check = test__checkevent_precise_max_modifier,
1580 .id = 47,
1581 },
1299static int count_tracepoints(void)
1300{
1301 struct dirent *events_ent;
1302 DIR *events_dir;
1303 int cnt = 0;
1304
1305 events_dir = opendir(tracing_events_path);
1306

--- 292 unchanged lines hidden (view full) ---

1599 .check = test__checkevent_exclude_idle_modifier_1,
1600 .id = 46,
1601 },
1602 {
1603 .name = "task-clock:P,cycles",
1604 .check = test__checkevent_precise_max_modifier,
1605 .id = 47,
1606 },
1607 {
1608 .name = "instructions/name=insn/",
1609 .check = test__checkevent_config_symbol,
1610 .id = 48,
1611 },
1612 {
1613 .name = "r1234/name=rawpmu/",
1614 .check = test__checkevent_config_raw,
1615 .id = 49,
1616 },
1617 {
1618 .name = "4:0x6530160/name=numpmu/",
1619 .check = test__checkevent_config_num,
1620 .id = 50,
1621 },
1582};
1583
1584static struct evlist_test test__events_pmu[] = {
1585 {
1586 .name = "cpu/config=10,config1,config2=3,period=1000/u",
1587 .check = test__checkevent_pmu,
1588 .id = 0,
1589 },

--- 208 unchanged lines hidden ---
1622};
1623
1624static struct evlist_test test__events_pmu[] = {
1625 {
1626 .name = "cpu/config=10,config1,config2=3,period=1000/u",
1627 .check = test__checkevent_pmu,
1628 .id = 0,
1629 },

--- 208 unchanged lines hidden ---