1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (C) 2021 Red Hat Inc, Daniel Bristot de Oliveira <bristot@kernel.org> 4 */ 5 6 #define _GNU_SOURCE 7 #include <getopt.h> 8 #include <stdlib.h> 9 #include <string.h> 10 #include <signal.h> 11 #include <unistd.h> 12 #include <errno.h> 13 #include <stdio.h> 14 #include <time.h> 15 16 #include "osnoise.h" 17 18 struct osnoise_hist_cpu { 19 int *samples; 20 int count; 21 22 unsigned long long min_sample; 23 unsigned long long sum_sample; 24 unsigned long long max_sample; 25 26 }; 27 28 struct osnoise_hist_data { 29 struct tracefs_hist *trace_hist; 30 struct osnoise_hist_cpu *hist; 31 int entries; 32 int bucket_size; 33 int nr_cpus; 34 }; 35 36 /* 37 * osnoise_free_histogram - free runtime data 38 */ 39 static void 40 osnoise_free_histogram(struct osnoise_hist_data *data) 41 { 42 int cpu; 43 44 /* one histogram for IRQ and one for thread, per CPU */ 45 for (cpu = 0; cpu < data->nr_cpus; cpu++) { 46 if (data->hist[cpu].samples) 47 free(data->hist[cpu].samples); 48 } 49 50 /* one set of histograms per CPU */ 51 if (data->hist) 52 free(data->hist); 53 54 free(data); 55 } 56 57 static void osnoise_free_hist_tool(struct osnoise_tool *tool) 58 { 59 osnoise_free_histogram(tool->data); 60 } 61 62 /* 63 * osnoise_alloc_histogram - alloc runtime data 64 */ 65 static struct osnoise_hist_data 66 *osnoise_alloc_histogram(int nr_cpus, int entries, int bucket_size) 67 { 68 struct osnoise_hist_data *data; 69 int cpu; 70 71 data = calloc(1, sizeof(*data)); 72 if (!data) 73 return NULL; 74 75 data->entries = entries; 76 data->bucket_size = bucket_size; 77 data->nr_cpus = nr_cpus; 78 79 data->hist = calloc(1, sizeof(*data->hist) * nr_cpus); 80 if (!data->hist) 81 goto cleanup; 82 83 for (cpu = 0; cpu < nr_cpus; cpu++) { 84 data->hist[cpu].samples = calloc(1, sizeof(*data->hist->samples) * (entries + 1)); 85 if (!data->hist[cpu].samples) 86 goto cleanup; 87 } 88 89 /* set the min to max */ 90 for (cpu = 0; cpu < nr_cpus; cpu++) 91 data->hist[cpu].min_sample = ~0; 92 93 return data; 94 95 cleanup: 96 osnoise_free_histogram(data); 97 return NULL; 98 } 99 100 static void osnoise_hist_update_multiple(struct osnoise_tool *tool, int cpu, 101 unsigned long long duration, int count) 102 { 103 struct osnoise_params *params = to_osnoise_params(tool->params); 104 struct osnoise_hist_data *data = tool->data; 105 unsigned long long total_duration; 106 int entries = data->entries; 107 int bucket; 108 int *hist; 109 110 if (params->common.output_divisor) 111 duration = duration / params->common.output_divisor; 112 113 bucket = duration / data->bucket_size; 114 115 total_duration = duration * count; 116 117 hist = data->hist[cpu].samples; 118 data->hist[cpu].count += count; 119 update_min(&data->hist[cpu].min_sample, &duration); 120 update_sum(&data->hist[cpu].sum_sample, &total_duration); 121 update_max(&data->hist[cpu].max_sample, &duration); 122 123 if (bucket < entries) 124 hist[bucket] += count; 125 else 126 hist[entries] += count; 127 } 128 129 /* 130 * osnoise_destroy_trace_hist - disable events used to collect histogram 131 */ 132 static void osnoise_destroy_trace_hist(struct osnoise_tool *tool) 133 { 134 struct osnoise_hist_data *data = tool->data; 135 136 tracefs_hist_pause(tool->trace.inst, data->trace_hist); 137 tracefs_hist_destroy(tool->trace.inst, data->trace_hist); 138 } 139 140 /* 141 * osnoise_init_trace_hist - enable events used to collect histogram 142 */ 143 static int osnoise_init_trace_hist(struct osnoise_tool *tool) 144 { 145 struct osnoise_params *params = to_osnoise_params(tool->params); 146 struct osnoise_hist_data *data = tool->data; 147 int bucket_size; 148 char buff[128]; 149 int retval = 0; 150 151 /* 152 * Set the size of the bucket. 153 */ 154 bucket_size = params->common.output_divisor * params->common.hist.bucket_size; 155 snprintf(buff, sizeof(buff), "duration.buckets=%d", bucket_size); 156 157 data->trace_hist = tracefs_hist_alloc(tool->trace.tep, "osnoise", "sample_threshold", 158 buff, TRACEFS_HIST_KEY_NORMAL); 159 if (!data->trace_hist) 160 return 1; 161 162 retval = tracefs_hist_add_key(data->trace_hist, "cpu", 0); 163 if (retval) 164 goto out_err; 165 166 retval = tracefs_hist_start(tool->trace.inst, data->trace_hist); 167 if (retval) 168 goto out_err; 169 170 return 0; 171 172 out_err: 173 osnoise_destroy_trace_hist(tool); 174 return 1; 175 } 176 177 /* 178 * osnoise_read_trace_hist - parse histogram file and file osnoise histogram 179 */ 180 static void osnoise_read_trace_hist(struct osnoise_tool *tool) 181 { 182 struct osnoise_hist_data *data = tool->data; 183 long long cpu, counter, duration; 184 char *content, *position; 185 186 tracefs_hist_pause(tool->trace.inst, data->trace_hist); 187 188 content = tracefs_event_file_read(tool->trace.inst, "osnoise", 189 "sample_threshold", 190 "hist", NULL); 191 if (!content) 192 return; 193 194 position = content; 195 while (true) { 196 position = strstr(position, "duration: ~"); 197 if (!position) 198 break; 199 position += strlen("duration: ~"); 200 duration = get_llong_from_str(position); 201 if (duration == -1) 202 err_msg("error reading duration from histogram\n"); 203 204 position = strstr(position, "cpu:"); 205 if (!position) 206 break; 207 position += strlen("cpu: "); 208 cpu = get_llong_from_str(position); 209 if (cpu == -1) 210 err_msg("error reading cpu from histogram\n"); 211 212 position = strstr(position, "hitcount:"); 213 if (!position) 214 break; 215 position += strlen("hitcount: "); 216 counter = get_llong_from_str(position); 217 if (counter == -1) 218 err_msg("error reading counter from histogram\n"); 219 220 osnoise_hist_update_multiple(tool, cpu, duration, counter); 221 } 222 free(content); 223 } 224 225 /* 226 * osnoise_hist_header - print the header of the tracer to the output 227 */ 228 static void osnoise_hist_header(struct osnoise_tool *tool) 229 { 230 struct osnoise_params *params = to_osnoise_params(tool->params); 231 struct osnoise_hist_data *data = tool->data; 232 struct trace_seq *s = tool->trace.seq; 233 char duration[26]; 234 int cpu; 235 236 if (params->common.hist.no_header) 237 return; 238 239 get_duration(tool->start_time, duration, sizeof(duration)); 240 trace_seq_printf(s, "# RTLA osnoise histogram\n"); 241 trace_seq_printf(s, "# Time unit is %s (%s)\n", 242 params->common.output_divisor == 1 ? "nanoseconds" : "microseconds", 243 params->common.output_divisor == 1 ? "ns" : "us"); 244 245 trace_seq_printf(s, "# Duration: %s\n", duration); 246 247 if (!params->common.hist.no_index) 248 trace_seq_printf(s, "Index"); 249 250 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 251 252 if (!data->hist[cpu].count) 253 continue; 254 255 trace_seq_printf(s, " CPU-%03d", cpu); 256 } 257 trace_seq_printf(s, "\n"); 258 259 trace_seq_do_printf(s); 260 trace_seq_reset(s); 261 } 262 263 /* 264 * osnoise_print_summary - print the summary of the hist data to the output 265 */ 266 static void 267 osnoise_print_summary(struct osnoise_params *params, 268 struct trace_instance *trace, 269 struct osnoise_hist_data *data) 270 { 271 int cpu; 272 273 if (params->common.hist.no_summary) 274 return; 275 276 if (!params->common.hist.no_index) 277 trace_seq_printf(trace->seq, "count:"); 278 279 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 280 281 if (!data->hist[cpu].count) 282 continue; 283 284 trace_seq_printf(trace->seq, "%9d ", data->hist[cpu].count); 285 } 286 trace_seq_printf(trace->seq, "\n"); 287 288 if (!params->common.hist.no_index) 289 trace_seq_printf(trace->seq, "min: "); 290 291 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 292 293 if (!data->hist[cpu].count) 294 continue; 295 296 trace_seq_printf(trace->seq, "%9llu ", data->hist[cpu].min_sample); 297 298 } 299 trace_seq_printf(trace->seq, "\n"); 300 301 if (!params->common.hist.no_index) 302 trace_seq_printf(trace->seq, "avg: "); 303 304 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 305 306 if (!data->hist[cpu].count) 307 continue; 308 309 if (data->hist[cpu].count) 310 trace_seq_printf(trace->seq, "%9.2f ", 311 ((double) data->hist[cpu].sum_sample) / data->hist[cpu].count); 312 else 313 trace_seq_printf(trace->seq, " - "); 314 } 315 trace_seq_printf(trace->seq, "\n"); 316 317 if (!params->common.hist.no_index) 318 trace_seq_printf(trace->seq, "max: "); 319 320 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 321 322 if (!data->hist[cpu].count) 323 continue; 324 325 trace_seq_printf(trace->seq, "%9llu ", data->hist[cpu].max_sample); 326 327 } 328 trace_seq_printf(trace->seq, "\n"); 329 trace_seq_do_printf(trace->seq); 330 trace_seq_reset(trace->seq); 331 } 332 333 /* 334 * osnoise_print_stats - print data for all CPUs 335 */ 336 static void 337 osnoise_print_stats(struct osnoise_tool *tool) 338 { 339 struct osnoise_params *params = to_osnoise_params(tool->params); 340 struct osnoise_hist_data *data = tool->data; 341 struct trace_instance *trace = &tool->trace; 342 int has_samples = 0; 343 int bucket, cpu; 344 int total; 345 346 osnoise_hist_header(tool); 347 348 for (bucket = 0; bucket < data->entries; bucket++) { 349 total = 0; 350 351 if (!params->common.hist.no_index) 352 trace_seq_printf(trace->seq, "%-6d", 353 bucket * data->bucket_size); 354 355 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 356 357 if (!data->hist[cpu].count) 358 continue; 359 360 total += data->hist[cpu].samples[bucket]; 361 trace_seq_printf(trace->seq, "%9d ", data->hist[cpu].samples[bucket]); 362 } 363 364 if (total == 0 && !params->common.hist.with_zeros) { 365 trace_seq_reset(trace->seq); 366 continue; 367 } 368 369 /* There are samples above the threshold */ 370 has_samples = 1; 371 trace_seq_printf(trace->seq, "\n"); 372 trace_seq_do_printf(trace->seq); 373 trace_seq_reset(trace->seq); 374 } 375 376 /* 377 * If no samples were recorded, skip calculations, print zeroed statistics 378 * and return. 379 */ 380 if (!has_samples) { 381 trace_seq_reset(trace->seq); 382 trace_seq_printf(trace->seq, "over: 0\ncount: 0\nmin: 0\navg: 0\nmax: 0\n"); 383 trace_seq_do_printf(trace->seq); 384 trace_seq_reset(trace->seq); 385 return; 386 } 387 388 if (!params->common.hist.no_index) 389 trace_seq_printf(trace->seq, "over: "); 390 391 for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { 392 393 if (!data->hist[cpu].count) 394 continue; 395 396 trace_seq_printf(trace->seq, "%9d ", 397 data->hist[cpu].samples[data->entries]); 398 } 399 trace_seq_printf(trace->seq, "\n"); 400 trace_seq_do_printf(trace->seq); 401 trace_seq_reset(trace->seq); 402 403 osnoise_print_summary(params, trace, data); 404 osnoise_report_missed_events(tool); 405 } 406 407 /* 408 * osnoise_hist_usage - prints osnoise hist usage message 409 */ 410 static void osnoise_hist_usage(void) 411 { 412 static const char * const msg_start[] = { 413 "[-D] [-d s] [-a us] [-p us] [-r us] [-s us] [-S us] \\", 414 " [-T us] [-t [file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] \\", 415 " [-c cpu-list] [-H cpu-list] [-P priority] [-b N] [-E N] [--no-header] [--no-summary] \\", 416 " [--no-index] [--with-zeros] [-C [cgroup_name]] [--warm-up]", 417 NULL, 418 }; 419 420 static const char * const msg_opts[] = { 421 " -a/--auto: set automatic trace mode, stopping the session if argument in us sample is hit", 422 " -p/--period us: osnoise period in us", 423 " -r/--runtime us: osnoise runtime in us", 424 " -s/--stop us: stop trace if a single sample is higher than the argument in us", 425 " -S/--stop-total us: stop trace if the total sample is higher than the argument in us", 426 " -T/--threshold us: the minimum delta to be considered a noise", 427 " -c/--cpus cpu-list: list of cpus to run osnoise threads", 428 " -H/--house-keeping cpus: run rtla control threads only on the given cpus", 429 " -C/--cgroup [cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited", 430 " -d/--duration time[s|m|h|d]: duration of the session", 431 " -D/--debug: print debug info", 432 " -t/--trace [file]: save the stopped trace to [file|osnoise_trace.txt]", 433 " -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed", 434 " --filter <filter>: enable a trace event filter to the previous -e event", 435 " --trigger <trigger>: enable a trace event trigger to the previous -e event", 436 " -b/--bucket-size N: set the histogram bucket size (default 1)", 437 " -E/--entries N: set the number of entries of the histogram (default 256)", 438 " --no-header: do not print header", 439 " --no-summary: do not print summary", 440 " --no-index: do not print index", 441 " --with-zeros: print zero only entries", 442 " -P/--priority o:prio|r:prio|f:prio|d:runtime:period: set scheduling parameters", 443 " o:prio - use SCHED_OTHER with prio", 444 " r:prio - use SCHED_RR with prio", 445 " f:prio - use SCHED_FIFO with prio", 446 " d:runtime[us|ms|s]:period[us|ms|s] - use SCHED_DEADLINE with runtime and period", 447 " in nanoseconds", 448 " --warm-up: let the workload run for s seconds before collecting data", 449 " --trace-buffer-size kB: set the per-cpu trace buffer size in kB", 450 " --on-threshold <action>: define action to be executed at stop-total threshold, multiple are allowed", 451 " --on-end <action>: define action to be executed at measurement end, multiple are allowed", 452 NULL, 453 }; 454 455 common_usage("osnoise", "hist", "a per-cpu histogram of the OS noise", 456 msg_start, msg_opts); 457 } 458 459 /* 460 * osnoise_hist_parse_args - allocs, parse and fill the cmd line parameters 461 */ 462 static struct common_params 463 *osnoise_hist_parse_args(int argc, char *argv[]) 464 { 465 struct osnoise_params *params; 466 struct trace_events *tevent; 467 int retval; 468 int c; 469 char *trace_output = NULL; 470 471 params = calloc(1, sizeof(*params)); 472 if (!params) 473 exit(1); 474 475 actions_init(¶ms->common.threshold_actions); 476 actions_init(¶ms->common.end_actions); 477 478 /* display data in microseconds */ 479 params->common.output_divisor = 1000; 480 params->common.hist.bucket_size = 1; 481 params->common.hist.entries = 256; 482 483 while (1) { 484 static struct option long_options[] = { 485 {"auto", required_argument, 0, 'a'}, 486 {"bucket-size", required_argument, 0, 'b'}, 487 {"entries", required_argument, 0, 'E'}, 488 {"cpus", required_argument, 0, 'c'}, 489 {"cgroup", optional_argument, 0, 'C'}, 490 {"debug", no_argument, 0, 'D'}, 491 {"duration", required_argument, 0, 'd'}, 492 {"house-keeping", required_argument, 0, 'H'}, 493 {"help", no_argument, 0, 'h'}, 494 {"period", required_argument, 0, 'p'}, 495 {"priority", required_argument, 0, 'P'}, 496 {"runtime", required_argument, 0, 'r'}, 497 {"stop", required_argument, 0, 's'}, 498 {"stop-total", required_argument, 0, 'S'}, 499 {"trace", optional_argument, 0, 't'}, 500 {"event", required_argument, 0, 'e'}, 501 {"threshold", required_argument, 0, 'T'}, 502 {"no-header", no_argument, 0, '0'}, 503 {"no-summary", no_argument, 0, '1'}, 504 {"no-index", no_argument, 0, '2'}, 505 {"with-zeros", no_argument, 0, '3'}, 506 {"trigger", required_argument, 0, '4'}, 507 {"filter", required_argument, 0, '5'}, 508 {"warm-up", required_argument, 0, '6'}, 509 {"trace-buffer-size", required_argument, 0, '7'}, 510 {"on-threshold", required_argument, 0, '8'}, 511 {"on-end", required_argument, 0, '9'}, 512 {0, 0, 0, 0} 513 }; 514 515 c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:", 516 long_options, NULL); 517 518 /* detect the end of the options. */ 519 if (c == -1) 520 break; 521 522 switch (c) { 523 case 'a': 524 /* set sample stop to auto_thresh */ 525 params->common.stop_us = get_llong_from_str(optarg); 526 527 /* set sample threshold to 1 */ 528 params->threshold = 1; 529 530 /* set trace */ 531 if (!trace_output) 532 trace_output = "osnoise_trace.txt"; 533 534 break; 535 case 'b': 536 params->common.hist.bucket_size = get_llong_from_str(optarg); 537 if (params->common.hist.bucket_size == 0 || 538 params->common.hist.bucket_size >= 1000000) 539 fatal("Bucket size needs to be > 0 and <= 1000000"); 540 break; 541 case 'c': 542 retval = parse_cpu_set(optarg, ¶ms->common.monitored_cpus); 543 if (retval) 544 fatal("Invalid -c cpu list"); 545 params->common.cpus = optarg; 546 break; 547 case 'C': 548 params->common.cgroup = 1; 549 params->common.cgroup_name = parse_optional_arg(argc, argv); 550 break; 551 case 'D': 552 config_debug = 1; 553 break; 554 case 'd': 555 params->common.duration = parse_seconds_duration(optarg); 556 if (!params->common.duration) 557 fatal("Invalid -D duration"); 558 break; 559 case 'e': 560 tevent = trace_event_alloc(optarg); 561 if (!tevent) 562 fatal("Error alloc trace event"); 563 564 if (params->common.events) 565 tevent->next = params->common.events; 566 567 params->common.events = tevent; 568 break; 569 case 'E': 570 params->common.hist.entries = get_llong_from_str(optarg); 571 if (params->common.hist.entries < 10 || 572 params->common.hist.entries > 9999999) 573 fatal("Entries must be > 10 and < 9999999"); 574 break; 575 case 'h': 576 case '?': 577 osnoise_hist_usage(); 578 break; 579 case 'H': 580 params->common.hk_cpus = 1; 581 retval = parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); 582 if (retval) 583 fatal("Error parsing house keeping CPUs"); 584 break; 585 case 'p': 586 params->period = get_llong_from_str(optarg); 587 if (params->period > 10000000) 588 fatal("Period longer than 10 s"); 589 break; 590 case 'P': 591 retval = parse_prio(optarg, ¶ms->common.sched_param); 592 if (retval == -1) 593 fatal("Invalid -P priority"); 594 params->common.set_sched = 1; 595 break; 596 case 'r': 597 params->runtime = get_llong_from_str(optarg); 598 if (params->runtime < 100) 599 fatal("Runtime shorter than 100 us"); 600 break; 601 case 's': 602 params->common.stop_us = get_llong_from_str(optarg); 603 break; 604 case 'S': 605 params->common.stop_total_us = get_llong_from_str(optarg); 606 break; 607 case 'T': 608 params->threshold = get_llong_from_str(optarg); 609 break; 610 case 't': 611 trace_output = parse_optional_arg(argc, argv); 612 if (!trace_output) 613 trace_output = "osnoise_trace.txt"; 614 break; 615 case '0': /* no header */ 616 params->common.hist.no_header = 1; 617 break; 618 case '1': /* no summary */ 619 params->common.hist.no_summary = 1; 620 break; 621 case '2': /* no index */ 622 params->common.hist.no_index = 1; 623 break; 624 case '3': /* with zeros */ 625 params->common.hist.with_zeros = 1; 626 break; 627 case '4': /* trigger */ 628 if (params->common.events) { 629 retval = trace_event_add_trigger(params->common.events, optarg); 630 if (retval) 631 fatal("Error adding trigger %s", optarg); 632 } else { 633 fatal("--trigger requires a previous -e"); 634 } 635 break; 636 case '5': /* filter */ 637 if (params->common.events) { 638 retval = trace_event_add_filter(params->common.events, optarg); 639 if (retval) 640 fatal("Error adding filter %s", optarg); 641 } else { 642 fatal("--filter requires a previous -e"); 643 } 644 break; 645 case '6': 646 params->common.warmup = get_llong_from_str(optarg); 647 break; 648 case '7': 649 params->common.buffer_size = get_llong_from_str(optarg); 650 break; 651 case '8': 652 retval = actions_parse(¶ms->common.threshold_actions, optarg, 653 "osnoise_trace.txt"); 654 if (retval) 655 fatal("Invalid action %s", optarg); 656 break; 657 case '9': 658 retval = actions_parse(¶ms->common.end_actions, optarg, 659 "osnoise_trace.txt"); 660 if (retval) 661 fatal("Invalid action %s", optarg); 662 break; 663 default: 664 fatal("Invalid option"); 665 } 666 } 667 668 if (trace_output) 669 actions_add_trace_output(¶ms->common.threshold_actions, trace_output); 670 671 if (geteuid()) 672 fatal("rtla needs root permission"); 673 674 if (params->common.hist.no_index && !params->common.hist.with_zeros) 675 fatal("no-index set and with-zeros not set - it does not make sense"); 676 677 return ¶ms->common; 678 } 679 680 /* 681 * osnoise_hist_apply_config - apply the hist configs to the initialized tool 682 */ 683 static int 684 osnoise_hist_apply_config(struct osnoise_tool *tool) 685 { 686 return osnoise_apply_config(tool, to_osnoise_params(tool->params)); 687 } 688 689 /* 690 * osnoise_init_hist - initialize a osnoise hist tool with parameters 691 */ 692 static struct osnoise_tool 693 *osnoise_init_hist(struct common_params *params) 694 { 695 struct osnoise_tool *tool; 696 int nr_cpus; 697 698 nr_cpus = sysconf(_SC_NPROCESSORS_CONF); 699 700 tool = osnoise_init_tool("osnoise_hist"); 701 if (!tool) 702 return NULL; 703 704 tool->data = osnoise_alloc_histogram(nr_cpus, params->hist.entries, 705 params->hist.bucket_size); 706 if (!tool->data) 707 goto out_err; 708 709 return tool; 710 711 out_err: 712 osnoise_destroy_tool(tool); 713 return NULL; 714 } 715 716 static int osnoise_hist_enable(struct osnoise_tool *tool) 717 { 718 int retval; 719 720 retval = osnoise_init_trace_hist(tool); 721 if (retval) 722 return retval; 723 724 return osnoise_enable(tool); 725 } 726 727 static int osnoise_hist_main_loop(struct osnoise_tool *tool) 728 { 729 int retval; 730 731 retval = hist_main_loop(tool); 732 osnoise_read_trace_hist(tool); 733 734 return retval; 735 } 736 737 struct tool_ops osnoise_hist_ops = { 738 .tracer = "osnoise", 739 .comm_prefix = "osnoise/", 740 .parse_args = osnoise_hist_parse_args, 741 .init_tool = osnoise_init_hist, 742 .apply_config = osnoise_hist_apply_config, 743 .enable = osnoise_hist_enable, 744 .main = osnoise_hist_main_loop, 745 .print_stats = osnoise_print_stats, 746 .free = osnoise_free_hist_tool, 747 }; 748