parse-events.c (41be702a542a0d14bb0b1c16e824fa9ed27616ec) parse-events.c (cd0cfad74eb88e54ba9d205da3ed376e48981448)
1
2#include "parse-events.h"
3#include "evsel.h"
4#include "evlist.h"
1
2#include "parse-events.h"
3#include "evsel.h"
4#include "evlist.h"
5#include "fs.h"
6#include <lk/debugfs.h>
5#include <api/fs/fs.h>
6#include <api/fs/debugfs.h>
7#include "tests.h"
8#include <linux/hw_breakpoint.h>
9
10#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
11 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
12
13static int test__checkevent_tracepoint(struct perf_evlist *evlist)
14{

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

25
26static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist)
27{
28 struct perf_evsel *evsel;
29
30 TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
31 TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups);
32
7#include "tests.h"
8#include <linux/hw_breakpoint.h>
9
10#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
11 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
12
13static int test__checkevent_tracepoint(struct perf_evlist *evlist)
14{

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

25
26static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist)
27{
28 struct perf_evsel *evsel;
29
30 TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
31 TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups);
32
33 list_for_each_entry(evsel, &evlist->entries, node) {
33 evlist__for_each(evlist, evsel) {
34 TEST_ASSERT_VAL("wrong type",
35 PERF_TYPE_TRACEPOINT == evsel->attr.type);
36 TEST_ASSERT_VAL("wrong sample_type",
37 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type);
38 TEST_ASSERT_VAL("wrong sample_period",
39 1 == evsel->attr.sample_period);
40 }
41 return 0;

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

196
197static int
198test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist)
199{
200 struct perf_evsel *evsel;
201
202 TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
203
34 TEST_ASSERT_VAL("wrong type",
35 PERF_TYPE_TRACEPOINT == evsel->attr.type);
36 TEST_ASSERT_VAL("wrong sample_type",
37 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type);
38 TEST_ASSERT_VAL("wrong sample_period",
39 1 == evsel->attr.sample_period);
40 }
41 return 0;

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

196
197static int
198test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist)
199{
200 struct perf_evsel *evsel;
201
202 TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
203
204 list_for_each_entry(evsel, &evlist->entries, node) {
204 evlist__for_each(evlist, evsel) {
205 TEST_ASSERT_VAL("wrong exclude_user",
206 !evsel->attr.exclude_user);
207 TEST_ASSERT_VAL("wrong exclude_kernel",
208 evsel->attr.exclude_kernel);
209 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
210 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
211 }
212

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

1380 evlist = perf_evlist__new();
1381 if (evlist == NULL)
1382 return -ENOMEM;
1383
1384 ret = parse_events(evlist, e->name);
1385 if (ret) {
1386 pr_debug("failed to parse event '%s', err %d\n",
1387 e->name, ret);
205 TEST_ASSERT_VAL("wrong exclude_user",
206 !evsel->attr.exclude_user);
207 TEST_ASSERT_VAL("wrong exclude_kernel",
208 evsel->attr.exclude_kernel);
209 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
210 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
211 }
212

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

1380 evlist = perf_evlist__new();
1381 if (evlist == NULL)
1382 return -ENOMEM;
1383
1384 ret = parse_events(evlist, e->name);
1385 if (ret) {
1386 pr_debug("failed to parse event '%s', err %d\n",
1387 e->name, ret);
1388 return ret;
1388 } else {
1389 ret = e->check(evlist);
1389 }
1390 }
1390
1391 ret = e->check(evlist);
1391
1392 perf_evlist__delete(evlist);
1393
1394 return ret;
1395}
1396
1397static int test_events(struct evlist_test *events, unsigned cnt)
1398{
1399 int ret1, ret2 = 0;

--- 139 unchanged lines hidden ---
1392 perf_evlist__delete(evlist);
1393
1394 return ret;
1395}
1396
1397static int test_events(struct evlist_test *events, unsigned cnt)
1398{
1399 int ret1, ret2 = 0;

--- 139 unchanged lines hidden ---