1414#include <time.h>
1515#include <sched.h>
1616
17- #include "utils.h"
1817#include "osnoise.h"
1918
20- struct osnoise_hist_params {
21- char * cpus ;
22- cpu_set_t monitored_cpus ;
23- char * trace_output ;
24- char * cgroup_name ;
25- unsigned long long runtime ;
26- unsigned long long period ;
27- long long threshold ;
28- long long stop_us ;
29- long long stop_total_us ;
30- int sleep_time ;
31- int duration ;
32- int set_sched ;
33- int output_divisor ;
34- int cgroup ;
35- int hk_cpus ;
36- cpu_set_t hk_cpu_set ;
37- struct sched_attr sched_param ;
38- struct trace_events * events ;
39- char no_header ;
40- char no_summary ;
41- char no_index ;
42- char with_zeros ;
43- int bucket_size ;
44- int entries ;
45- int warmup ;
46- int buffer_size ;
47- };
48-
4919struct osnoise_hist_cpu {
5020 int * samples ;
5121 int count ;
@@ -126,7 +96,7 @@ static struct osnoise_hist_data
12696static void osnoise_hist_update_multiple (struct osnoise_tool * tool , int cpu ,
12797 unsigned long long duration , int count )
12898{
129- struct osnoise_hist_params * params = tool -> params ;
99+ struct osnoise_params * params = tool -> params ;
130100 struct osnoise_hist_data * data = tool -> data ;
131101 unsigned long long total_duration ;
132102 int entries = data -> entries ;
@@ -168,7 +138,7 @@ static void osnoise_destroy_trace_hist(struct osnoise_tool *tool)
168138 */
169139static int osnoise_init_trace_hist (struct osnoise_tool * tool )
170140{
171- struct osnoise_hist_params * params = tool -> params ;
141+ struct osnoise_params * params = tool -> params ;
172142 struct osnoise_hist_data * data = tool -> data ;
173143 int bucket_size ;
174144 char buff [128 ];
@@ -253,7 +223,7 @@ static void osnoise_read_trace_hist(struct osnoise_tool *tool)
253223 */
254224static void osnoise_hist_header (struct osnoise_tool * tool )
255225{
256- struct osnoise_hist_params * params = tool -> params ;
226+ struct osnoise_params * params = tool -> params ;
257227 struct osnoise_hist_data * data = tool -> data ;
258228 struct trace_seq * s = tool -> trace .seq ;
259229 char duration [26 ];
@@ -292,7 +262,7 @@ static void osnoise_hist_header(struct osnoise_tool *tool)
292262 * osnoise_print_summary - print the summary of the hist data to the output
293263 */
294264static void
295- osnoise_print_summary (struct osnoise_hist_params * params ,
265+ osnoise_print_summary (struct osnoise_params * params ,
296266 struct trace_instance * trace ,
297267 struct osnoise_hist_data * data )
298268{
@@ -370,7 +340,7 @@ osnoise_print_summary(struct osnoise_hist_params *params,
370340 * osnoise_print_stats - print data for all CPUs
371341 */
372342static void
373- osnoise_print_stats (struct osnoise_hist_params * params , struct osnoise_tool * tool )
343+ osnoise_print_stats (struct osnoise_params * params , struct osnoise_tool * tool )
374344{
375345 struct osnoise_hist_data * data = tool -> data ;
376346 struct trace_instance * trace = & tool -> trace ;
@@ -508,10 +478,10 @@ static void osnoise_hist_usage(char *usage)
508478/*
509479 * osnoise_hist_parse_args - allocs, parse and fill the cmd line parameters
510480 */
511- static struct osnoise_hist_params
481+ static struct osnoise_params
512482* osnoise_hist_parse_args (int argc , char * argv [])
513483{
514- struct osnoise_hist_params * params ;
484+ struct osnoise_params * params ;
515485 struct trace_events * tevent ;
516486 int retval ;
517487 int c ;
@@ -731,7 +701,7 @@ static struct osnoise_hist_params
731701 * osnoise_hist_apply_config - apply the hist configs to the initialized tool
732702 */
733703static int
734- osnoise_hist_apply_config (struct osnoise_tool * tool , struct osnoise_hist_params * params )
704+ osnoise_hist_apply_config (struct osnoise_tool * tool , struct osnoise_params * params )
735705{
736706 int retval ;
737707
@@ -808,7 +778,7 @@ osnoise_hist_apply_config(struct osnoise_tool *tool, struct osnoise_hist_params
808778 * osnoise_init_hist - initialize a osnoise hist tool with parameters
809779 */
810780static struct osnoise_tool
811- * osnoise_init_hist (struct osnoise_hist_params * params )
781+ * osnoise_init_hist (struct osnoise_params * params )
812782{
813783 struct osnoise_tool * tool ;
814784 int nr_cpus ;
@@ -842,7 +812,7 @@ static void stop_hist(int sig)
842812 * osnoise_hist_set_signals - handles the signal to stop the tool
843813 */
844814static void
845- osnoise_hist_set_signals (struct osnoise_hist_params * params )
815+ osnoise_hist_set_signals (struct osnoise_params * params )
846816{
847817 signal (SIGINT , stop_hist );
848818 if (params -> duration ) {
@@ -853,7 +823,7 @@ osnoise_hist_set_signals(struct osnoise_hist_params *params)
853823
854824int osnoise_hist_main (int argc , char * argv [])
855825{
856- struct osnoise_hist_params * params ;
826+ struct osnoise_params * params ;
857827 struct osnoise_tool * record = NULL ;
858828 struct osnoise_tool * tool = NULL ;
859829 struct trace_instance * trace ;
0 commit comments