@@ -315,33 +315,6 @@ static inline void osn_var_reset_all(void)
315
315
*/
316
316
bool trace_osnoise_callback_enabled ;
317
317
318
- /*
319
- * osnoise sample structure definition. Used to store the statistics of a
320
- * sample run.
321
- */
322
- struct osnoise_sample {
323
- u64 runtime ; /* runtime */
324
- u64 noise ; /* noise */
325
- u64 max_sample ; /* max single noise sample */
326
- int hw_count ; /* # HW (incl. hypervisor) interference */
327
- int nmi_count ; /* # NMIs during this sample */
328
- int irq_count ; /* # IRQs during this sample */
329
- int softirq_count ; /* # softirqs during this sample */
330
- int thread_count ; /* # threads during this sample */
331
- };
332
-
333
- #ifdef CONFIG_TIMERLAT_TRACER
334
- /*
335
- * timerlat sample structure definition. Used to store the statistics of
336
- * a sample run.
337
- */
338
- struct timerlat_sample {
339
- u64 timer_latency ; /* timer_latency */
340
- unsigned int seqnum ; /* unique sequence */
341
- int context ; /* timer context */
342
- };
343
- #endif
344
-
345
318
/*
346
319
* Tracer data.
347
320
*/
@@ -497,7 +470,7 @@ static void print_osnoise_headers(struct seq_file *s)
497
470
* Record an osnoise_sample into the tracer buffer.
498
471
*/
499
472
static void
500
- __trace_osnoise_sample (struct osnoise_sample * sample , struct trace_buffer * buffer )
473
+ __record_osnoise_sample (struct osnoise_sample * sample , struct trace_buffer * buffer )
501
474
{
502
475
struct ring_buffer_event * event ;
503
476
struct osnoise_entry * entry ;
@@ -520,17 +493,19 @@ __trace_osnoise_sample(struct osnoise_sample *sample, struct trace_buffer *buffe
520
493
}
521
494
522
495
/*
523
- * Record an osnoise_sample on all osnoise instances.
496
+ * Record an osnoise_sample on all osnoise instances and fire trace event .
524
497
*/
525
- static void trace_osnoise_sample (struct osnoise_sample * sample )
498
+ static void record_osnoise_sample (struct osnoise_sample * sample )
526
499
{
527
500
struct osnoise_instance * inst ;
528
501
struct trace_buffer * buffer ;
529
502
503
+ trace_osnoise_sample (sample );
504
+
530
505
rcu_read_lock ();
531
506
list_for_each_entry_rcu (inst , & osnoise_instances , list ) {
532
507
buffer = inst -> tr -> array_buffer .buffer ;
533
- __trace_osnoise_sample (sample , buffer );
508
+ __record_osnoise_sample (sample , buffer );
534
509
}
535
510
rcu_read_unlock ();
536
511
}
@@ -574,7 +549,7 @@ static void print_timerlat_headers(struct seq_file *s)
574
549
#endif /* CONFIG_PREEMPT_RT */
575
550
576
551
static void
577
- __trace_timerlat_sample (struct timerlat_sample * sample , struct trace_buffer * buffer )
552
+ __record_timerlat_sample (struct timerlat_sample * sample , struct trace_buffer * buffer )
578
553
{
579
554
struct ring_buffer_event * event ;
580
555
struct timerlat_entry * entry ;
@@ -594,15 +569,17 @@ __trace_timerlat_sample(struct timerlat_sample *sample, struct trace_buffer *buf
594
569
/*
595
570
* Record an timerlat_sample into the tracer buffer.
596
571
*/
597
- static void trace_timerlat_sample (struct timerlat_sample * sample )
572
+ static void record_timerlat_sample (struct timerlat_sample * sample )
598
573
{
599
574
struct osnoise_instance * inst ;
600
575
struct trace_buffer * buffer ;
601
576
577
+ trace_timerlat_sample (sample );
578
+
602
579
rcu_read_lock ();
603
580
list_for_each_entry_rcu (inst , & osnoise_instances , list ) {
604
581
buffer = inst -> tr -> array_buffer .buffer ;
605
- __trace_timerlat_sample (sample , buffer );
582
+ __record_timerlat_sample (sample , buffer );
606
583
}
607
584
rcu_read_unlock ();
608
585
}
@@ -1608,7 +1585,7 @@ static int run_osnoise(void)
1608
1585
/* Save interference stats info */
1609
1586
diff_osn_sample_stats (osn_var , & s );
1610
1587
1611
- trace_osnoise_sample (& s );
1588
+ record_osnoise_sample (& s );
1612
1589
1613
1590
notify_new_max_latency (max_noise );
1614
1591
@@ -1803,7 +1780,7 @@ static enum hrtimer_restart timerlat_irq(struct hrtimer *timer)
1803
1780
s .timer_latency = diff ;
1804
1781
s .context = IRQ_CONTEXT ;
1805
1782
1806
- trace_timerlat_sample (& s );
1783
+ record_timerlat_sample (& s );
1807
1784
1808
1785
if (osnoise_data .stop_tracing ) {
1809
1786
if (time_to_us (diff ) >= osnoise_data .stop_tracing ) {
@@ -1923,7 +1900,7 @@ static int timerlat_main(void *data)
1923
1900
s .timer_latency = diff ;
1924
1901
s .context = THREAD_CONTEXT ;
1925
1902
1926
- trace_timerlat_sample (& s );
1903
+ record_timerlat_sample (& s );
1927
1904
1928
1905
notify_new_max_latency (diff );
1929
1906
@@ -2529,7 +2506,7 @@ timerlat_fd_read(struct file *file, char __user *ubuf, size_t count,
2529
2506
s .timer_latency = diff ;
2530
2507
s .context = THREAD_URET ;
2531
2508
2532
- trace_timerlat_sample (& s );
2509
+ record_timerlat_sample (& s );
2533
2510
2534
2511
notify_new_max_latency (diff );
2535
2512
@@ -2564,7 +2541,7 @@ timerlat_fd_read(struct file *file, char __user *ubuf, size_t count,
2564
2541
s .timer_latency = diff ;
2565
2542
s .context = THREAD_CONTEXT ;
2566
2543
2567
- trace_timerlat_sample (& s );
2544
+ record_timerlat_sample (& s );
2568
2545
2569
2546
if (osnoise_data .stop_tracing_total ) {
2570
2547
if (time_to_us (diff ) >= osnoise_data .stop_tracing_total ) {
0 commit comments