@@ -195,6 +195,11 @@ static struct perf_stat_config stat_config = {
195
195
.scale = true,
196
196
};
197
197
198
+ static bool is_duration_time (struct perf_evsel * evsel )
199
+ {
200
+ return !strcmp (evsel -> name , "duration_time" );
201
+ }
202
+
198
203
static inline void diff_timespec (struct timespec * r , struct timespec * a ,
199
204
struct timespec * b )
200
205
{
@@ -1363,6 +1368,9 @@ static void print_aggr(char *prefix)
1363
1368
ad .id = id = aggr_map -> map [s ];
1364
1369
first = true;
1365
1370
evlist__for_each_entry (evsel_list , counter ) {
1371
+ if (is_duration_time (counter ))
1372
+ continue ;
1373
+
1366
1374
ad .val = ad .ena = ad .run = 0 ;
1367
1375
ad .nr = 0 ;
1368
1376
if (!collect_data (counter , aggr_cb , & ad ))
@@ -1506,6 +1514,8 @@ static void print_no_aggr_metric(char *prefix)
1506
1514
if (prefix )
1507
1515
fputs (prefix , stat_config .output );
1508
1516
evlist__for_each_entry (evsel_list , counter ) {
1517
+ if (is_duration_time (counter ))
1518
+ continue ;
1509
1519
if (first ) {
1510
1520
aggr_printout (counter , cpu , 0 );
1511
1521
first = false;
@@ -1560,6 +1570,8 @@ static void print_metric_headers(const char *prefix, bool no_indent)
1560
1570
1561
1571
/* Print metrics headers only */
1562
1572
evlist__for_each_entry (evsel_list , counter ) {
1573
+ if (is_duration_time (counter ))
1574
+ continue ;
1563
1575
os .evsel = counter ;
1564
1576
out .ctx = & os ;
1565
1577
out .print_metric = print_metric_header ;
@@ -1707,21 +1719,30 @@ static void print_counters(struct timespec *ts, int argc, const char **argv)
1707
1719
print_aggr (prefix );
1708
1720
break ;
1709
1721
case AGGR_THREAD :
1710
- evlist__for_each_entry (evsel_list , counter )
1722
+ evlist__for_each_entry (evsel_list , counter ) {
1723
+ if (is_duration_time (counter ))
1724
+ continue ;
1711
1725
print_aggr_thread (counter , prefix );
1726
+ }
1712
1727
break ;
1713
1728
case AGGR_GLOBAL :
1714
- evlist__for_each_entry (evsel_list , counter )
1729
+ evlist__for_each_entry (evsel_list , counter ) {
1730
+ if (is_duration_time (counter ))
1731
+ continue ;
1715
1732
print_counter_aggr (counter , prefix );
1733
+ }
1716
1734
if (metric_only )
1717
1735
fputc ('\n' , stat_config .output );
1718
1736
break ;
1719
1737
case AGGR_NONE :
1720
1738
if (metric_only )
1721
1739
print_no_aggr_metric (prefix );
1722
1740
else {
1723
- evlist__for_each_entry (evsel_list , counter )
1741
+ evlist__for_each_entry (evsel_list , counter ) {
1742
+ if (is_duration_time (counter ))
1743
+ continue ;
1724
1744
print_counter (counter , prefix );
1745
+ }
1725
1746
}
1726
1747
break ;
1727
1748
case AGGR_UNSET :
0 commit comments