@@ -773,7 +773,7 @@ const char *evsel__name(struct evsel *evsel)
773
773
774
774
case PERF_TYPE_SOFTWARE :
775
775
if (evsel__is_tool (evsel ))
776
- evsel__tool_name (evsel -> tool_event , bf , sizeof (bf ));
776
+ evsel__tool_name (evsel__tool_event ( evsel ) , bf , sizeof (bf ));
777
777
else
778
778
evsel__sw_name (evsel , bf , sizeof (bf ));
779
779
break ;
@@ -811,7 +811,7 @@ const char *evsel__metric_id(const struct evsel *evsel)
811
811
return evsel -> metric_id ;
812
812
813
813
if (evsel__is_tool (evsel ))
814
- return perf_tool_event__to_str (evsel -> tool_event );
814
+ return perf_tool_event__to_str (evsel__tool_event ( evsel ) );
815
815
816
816
return "unknown" ;
817
817
}
@@ -1503,8 +1503,8 @@ void evsel__exit(struct evsel *evsel)
1503
1503
evsel -> per_pkg_mask = NULL ;
1504
1504
zfree (& evsel -> metric_events );
1505
1505
perf_evsel__object .fini (evsel );
1506
- if (evsel -> tool_event == PERF_TOOL_SYSTEM_TIME ||
1507
- evsel -> tool_event == PERF_TOOL_USER_TIME )
1506
+ if (evsel__tool_event ( evsel ) == PERF_TOOL_SYSTEM_TIME ||
1507
+ evsel__tool_event ( evsel ) == PERF_TOOL_USER_TIME )
1508
1508
xyarray__delete (evsel -> start_times );
1509
1509
}
1510
1510
@@ -1785,7 +1785,7 @@ static int evsel__read_tool(struct evsel *evsel, int cpu_map_idx, int thread)
1785
1785
1786
1786
count = perf_counts (evsel -> counts , cpu_map_idx , thread );
1787
1787
1788
- switch (evsel -> tool_event ) {
1788
+ switch (evsel__tool_event ( evsel ) ) {
1789
1789
case PERF_TOOL_DURATION_TIME :
1790
1790
/*
1791
1791
* Pretend duration_time is only on the first CPU and thread, or
@@ -1800,7 +1800,7 @@ static int evsel__read_tool(struct evsel *evsel, int cpu_map_idx, int thread)
1800
1800
break ;
1801
1801
case PERF_TOOL_USER_TIME :
1802
1802
case PERF_TOOL_SYSTEM_TIME : {
1803
- bool system = evsel -> tool_event == PERF_TOOL_SYSTEM_TIME ;
1803
+ bool system = evsel__tool_event ( evsel ) == PERF_TOOL_SYSTEM_TIME ;
1804
1804
1805
1805
start_time = xyarray__entry (evsel -> start_times , cpu_map_idx , thread );
1806
1806
fd = FD (evsel , cpu_map_idx , thread );
@@ -2072,8 +2072,8 @@ static int __evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus,
2072
2072
perf_evsel__alloc_fd (& evsel -> core , perf_cpu_map__nr (cpus ), nthreads ) < 0 )
2073
2073
return - ENOMEM ;
2074
2074
2075
- if ((evsel -> tool_event == PERF_TOOL_SYSTEM_TIME ||
2076
- evsel -> tool_event == PERF_TOOL_USER_TIME ) &&
2075
+ if ((evsel__tool_event ( evsel ) == PERF_TOOL_SYSTEM_TIME ||
2076
+ evsel__tool_event ( evsel ) == PERF_TOOL_USER_TIME ) &&
2077
2077
!evsel -> start_times ) {
2078
2078
evsel -> start_times = xyarray__new (perf_cpu_map__nr (cpus ), nthreads , sizeof (__u64 ));
2079
2079
if (!evsel -> start_times )
@@ -2262,7 +2262,7 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
2262
2262
int pid = -1 , err , old_errno ;
2263
2263
enum rlimit_action set_rlimit = NO_CHANGE ;
2264
2264
2265
- if (evsel -> tool_event == PERF_TOOL_DURATION_TIME ) {
2265
+ if (evsel__tool_event ( evsel ) == PERF_TOOL_DURATION_TIME ) {
2266
2266
if (evsel -> core .attr .sample_period ) /* no sampling */
2267
2267
return - EINVAL ;
2268
2268
evsel -> start_time = rdclock ();
@@ -2304,9 +2304,9 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
2304
2304
if (!evsel -> cgrp && !evsel -> core .system_wide )
2305
2305
pid = perf_thread_map__pid (threads , thread );
2306
2306
2307
- if (evsel -> tool_event == PERF_TOOL_USER_TIME ||
2308
- evsel -> tool_event == PERF_TOOL_SYSTEM_TIME ) {
2309
- bool system = evsel -> tool_event == PERF_TOOL_SYSTEM_TIME ;
2307
+ if (evsel__tool_event ( evsel ) == PERF_TOOL_USER_TIME ||
2308
+ evsel__tool_event ( evsel ) == PERF_TOOL_SYSTEM_TIME ) {
2309
+ bool system = evsel__tool_event ( evsel ) == PERF_TOOL_SYSTEM_TIME ;
2310
2310
__u64 * start_time = NULL ;
2311
2311
2312
2312
if (evsel -> core .attr .sample_period ) {
0 commit comments