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 {"cgroup", optional_argument, 0, 'C'}, 489 {"debug", no_argument, 0, 'D'}, 490 {"duration", required_argument, 0, 'd'}, 491 {"house-keeping", required_argument, 0, 'H'}, 492 {"help", no_argument, 0, 'h'}, 493 {"period", required_argument, 0, 'p'}, 494 {"priority", required_argument, 0, 'P'}, 495 {"runtime", required_argument, 0, 'r'}, 496 {"stop", required_argument, 0, 's'}, 497 {"stop-total", required_argument, 0, 'S'}, 498 {"trace", optional_argument, 0, 't'}, 499 {"event", required_argument, 0, 'e'}, 500 {"threshold", required_argument, 0, 'T'}, 501 {"no-header", no_argument, 0, '0'}, 502 {"no-summary", no_argument, 0, '1'}, 503 {"no-index", no_argument, 0, '2'}, 504 {"with-zeros", no_argument, 0, '3'}, 505 {"trigger", required_argument, 0, '4'}, 506 {"filter", required_argument, 0, '5'}, 507 {"warm-up", required_argument, 0, '6'}, 508 {"trace-buffer-size", required_argument, 0, '7'}, 509 {"on-threshold", required_argument, 0, '8'}, 510 {"on-end", required_argument, 0, '9'}, 511 {0, 0, 0, 0} 512 }; 513 514 if (common_parse_options(argc, argv, ¶ms->common)) 515 continue; 516 517 c = getopt_long(argc, argv, "a:C::b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:", 518 long_options, NULL); 519 520 /* detect the end of the options. */ 521 if (c == -1) 522 break; 523 524 switch (c) { 525 case 'a': 526 /* set sample stop to auto_thresh */ 527 params->common.stop_us = get_llong_from_str(optarg); 528 529 /* set sample threshold to 1 */ 530 params->threshold = 1; 531 532 /* set trace */ 533 if (!trace_output) 534 trace_output = "osnoise_trace.txt"; 535 536 break; 537 case 'b': 538 params->common.hist.bucket_size = get_llong_from_str(optarg); 539 if (params->common.hist.bucket_size == 0 || 540 params->common.hist.bucket_size >= 1000000) 541 fatal("Bucket size needs to be > 0 and <= 1000000"); 542 break; 543 case 'C': 544 params->common.cgroup = 1; 545 params->common.cgroup_name = parse_optional_arg(argc, argv); 546 break; 547 case 'D': 548 config_debug = 1; 549 break; 550 case 'd': 551 params->common.duration = parse_seconds_duration(optarg); 552 if (!params->common.duration) 553 fatal("Invalid -D duration"); 554 break; 555 case 'e': 556 tevent = trace_event_alloc(optarg); 557 if (!tevent) 558 fatal("Error alloc trace event"); 559 560 if (params->common.events) 561 tevent->next = params->common.events; 562 563 params->common.events = tevent; 564 break; 565 case 'E': 566 params->common.hist.entries = get_llong_from_str(optarg); 567 if (params->common.hist.entries < 10 || 568 params->common.hist.entries > 9999999) 569 fatal("Entries must be > 10 and < 9999999"); 570 break; 571 case 'h': 572 case '?': 573 osnoise_hist_usage(); 574 break; 575 case 'H': 576 params->common.hk_cpus = 1; 577 retval = parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); 578 if (retval) 579 fatal("Error parsing house keeping CPUs"); 580 break; 581 case 'p': 582 params->period = get_llong_from_str(optarg); 583 if (params->period > 10000000) 584 fatal("Period longer than 10 s"); 585 break; 586 case 'P': 587 retval = parse_prio(optarg, ¶ms->common.sched_param); 588 if (retval == -1) 589 fatal("Invalid -P priority"); 590 params->common.set_sched = 1; 591 break; 592 case 'r': 593 params->runtime = get_llong_from_str(optarg); 594 if (params->runtime < 100) 595 fatal("Runtime shorter than 100 us"); 596 break; 597 case 's': 598 params->common.stop_us = get_llong_from_str(optarg); 599 break; 600 case 'S': 601 params->common.stop_total_us = get_llong_from_str(optarg); 602 break; 603 case 'T': 604 params->threshold = get_llong_from_str(optarg); 605 break; 606 case 't': 607 trace_output = parse_optional_arg(argc, argv); 608 if (!trace_output) 609 trace_output = "osnoise_trace.txt"; 610 break; 611 case '0': /* no header */ 612 params->common.hist.no_header = 1; 613 break; 614 case '1': /* no summary */ 615 params->common.hist.no_summary = 1; 616 break; 617 case '2': /* no index */ 618 params->common.hist.no_index = 1; 619 break; 620 case '3': /* with zeros */ 621 params->common.hist.with_zeros = 1; 622 break; 623 case '4': /* trigger */ 624 if (params->common.events) { 625 retval = trace_event_add_trigger(params->common.events, optarg); 626 if (retval) 627 fatal("Error adding trigger %s", optarg); 628 } else { 629 fatal("--trigger requires a previous -e"); 630 } 631 break; 632 case '5': /* filter */ 633 if (params->common.events) { 634 retval = trace_event_add_filter(params->common.events, optarg); 635 if (retval) 636 fatal("Error adding filter %s", optarg); 637 } else { 638 fatal("--filter requires a previous -e"); 639 } 640 break; 641 case '6': 642 params->common.warmup = get_llong_from_str(optarg); 643 break; 644 case '7': 645 params->common.buffer_size = get_llong_from_str(optarg); 646 break; 647 case '8': 648 retval = actions_parse(¶ms->common.threshold_actions, optarg, 649 "osnoise_trace.txt"); 650 if (retval) 651 fatal("Invalid action %s", optarg); 652 break; 653 case '9': 654 retval = actions_parse(¶ms->common.end_actions, optarg, 655 "osnoise_trace.txt"); 656 if (retval) 657 fatal("Invalid action %s", optarg); 658 break; 659 default: 660 fatal("Invalid option"); 661 } 662 } 663 664 if (trace_output) 665 actions_add_trace_output(¶ms->common.threshold_actions, trace_output); 666 667 if (geteuid()) 668 fatal("rtla needs root permission"); 669 670 if (params->common.hist.no_index && !params->common.hist.with_zeros) 671 fatal("no-index set and with-zeros not set - it does not make sense"); 672 673 return ¶ms->common; 674 } 675 676 /* 677 * osnoise_hist_apply_config - apply the hist configs to the initialized tool 678 */ 679 static int 680 osnoise_hist_apply_config(struct osnoise_tool *tool) 681 { 682 return osnoise_apply_config(tool, to_osnoise_params(tool->params)); 683 } 684 685 /* 686 * osnoise_init_hist - initialize a osnoise hist tool with parameters 687 */ 688 static struct osnoise_tool 689 *osnoise_init_hist(struct common_params *params) 690 { 691 struct osnoise_tool *tool; 692 int nr_cpus; 693 694 nr_cpus = sysconf(_SC_NPROCESSORS_CONF); 695 696 tool = osnoise_init_tool("osnoise_hist"); 697 if (!tool) 698 return NULL; 699 700 tool->data = osnoise_alloc_histogram(nr_cpus, params->hist.entries, 701 params->hist.bucket_size); 702 if (!tool->data) 703 goto out_err; 704 705 return tool; 706 707 out_err: 708 osnoise_destroy_tool(tool); 709 return NULL; 710 } 711 712 static int osnoise_hist_enable(struct osnoise_tool *tool) 713 { 714 int retval; 715 716 retval = osnoise_init_trace_hist(tool); 717 if (retval) 718 return retval; 719 720 return osnoise_enable(tool); 721 } 722 723 static int osnoise_hist_main_loop(struct osnoise_tool *tool) 724 { 725 int retval; 726 727 retval = hist_main_loop(tool); 728 osnoise_read_trace_hist(tool); 729 730 return retval; 731 } 732 733 struct tool_ops osnoise_hist_ops = { 734 .tracer = "osnoise", 735 .comm_prefix = "osnoise/", 736 .parse_args = osnoise_hist_parse_args, 737 .init_tool = osnoise_init_hist, 738 .apply_config = osnoise_hist_apply_config, 739 .enable = osnoise_hist_enable, 740 .main = osnoise_hist_main_loop, 741 .print_stats = osnoise_print_stats, 742 .free = osnoise_free_hist_tool, 743 }; 744