Lines Matching refs:fprintf
549 fprintf(stderr, "couldn't open %s\n", fname); in perl_generate_script()
553 fprintf(ofp, "# perf script event handlers, " in perl_generate_script()
556 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in perl_generate_script()
559 fprintf(ofp, "# The common_* event handler fields are the most useful " in perl_generate_script()
562 fprintf(ofp, "# all events. They don't necessarily correspond to " in perl_generate_script()
565 fprintf(ofp, "# in the format files. Those fields not available as " in perl_generate_script()
568 fprintf(ofp, "# be retrieved using Perl functions of the form " in perl_generate_script()
571 fprintf(ofp, "# See Context.pm for the list of available " in perl_generate_script()
574 fprintf(ofp, "use lib \"$ENV{'PERF_EXEC_PATH'}/scripts/perl/" in perl_generate_script()
577 fprintf(ofp, "use lib \"./Perf-Trace-Util/lib\";\n"); in perl_generate_script()
578 fprintf(ofp, "use Perf::Trace::Core;\n"); in perl_generate_script()
579 fprintf(ofp, "use Perf::Trace::Context;\n"); in perl_generate_script()
580 fprintf(ofp, "use Perf::Trace::Util;\n\n"); in perl_generate_script()
582 fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n"); in perl_generate_script()
583 fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n"); in perl_generate_script()
586 fprintf(ofp, "\n\ in perl_generate_script()
606 fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name); in perl_generate_script()
607 fprintf(ofp, "\tmy ("); in perl_generate_script()
609 fprintf(ofp, "$event_name, "); in perl_generate_script()
610 fprintf(ofp, "$context, "); in perl_generate_script()
611 fprintf(ofp, "$common_cpu, "); in perl_generate_script()
612 fprintf(ofp, "$common_secs, "); in perl_generate_script()
613 fprintf(ofp, "$common_nsecs,\n"); in perl_generate_script()
614 fprintf(ofp, "\t $common_pid, "); in perl_generate_script()
615 fprintf(ofp, "$common_comm, "); in perl_generate_script()
616 fprintf(ofp, "$common_callchain,\n\t "); in perl_generate_script()
623 fprintf(ofp, ", "); in perl_generate_script()
625 fprintf(ofp, "\n\t "); in perl_generate_script()
627 fprintf(ofp, "$%s", f->name); in perl_generate_script()
629 fprintf(ofp, ") = @_;\n\n"); in perl_generate_script()
631 fprintf(ofp, "\tprint_header($event_name, $common_cpu, " in perl_generate_script()
635 fprintf(ofp, "\tprintf(\""); in perl_generate_script()
642 fprintf(ofp, ", "); in perl_generate_script()
644 fprintf(ofp, "\".\n\t \""); in perl_generate_script()
648 fprintf(ofp, "%s=", f->name); in perl_generate_script()
652 fprintf(ofp, "%%s"); in perl_generate_script()
654 fprintf(ofp, "%%d"); in perl_generate_script()
656 fprintf(ofp, "%%u"); in perl_generate_script()
659 fprintf(ofp, "\\n\",\n\t "); in perl_generate_script()
666 fprintf(ofp, ", "); in perl_generate_script()
669 fprintf(ofp, "\n\t "); in perl_generate_script()
673 fprintf(ofp, "\n\t "); in perl_generate_script()
676 fprintf(ofp, "flag_str(\""); in perl_generate_script()
677 fprintf(ofp, "%s::%s\", ", event->system, in perl_generate_script()
679 fprintf(ofp, "\"%s\", $%s)", f->name, in perl_generate_script()
683 fprintf(ofp, "\n\t "); in perl_generate_script()
686 fprintf(ofp, "symbol_str(\""); in perl_generate_script()
687 fprintf(ofp, "%s::%s\", ", event->system, in perl_generate_script()
689 fprintf(ofp, "\"%s\", $%s)", f->name, in perl_generate_script()
692 fprintf(ofp, "$%s", f->name); in perl_generate_script()
695 fprintf(ofp, ");\n\n"); in perl_generate_script()
697 fprintf(ofp, "\tprint_backtrace($common_callchain);\n"); in perl_generate_script()
699 fprintf(ofp, "}\n\n"); in perl_generate_script()
702 fprintf(ofp, "sub trace_unhandled\n{\n\tmy ($event_name, $context, " in perl_generate_script()
706 fprintf(ofp, "\tprint_header($event_name, $common_cpu, " in perl_generate_script()
709 fprintf(ofp, "\tprint_backtrace($common_callchain);\n"); in perl_generate_script()
710 fprintf(ofp, "}\n\n"); in perl_generate_script()
712 fprintf(ofp, "sub print_header\n{\n" in perl_generate_script()
717 fprintf(ofp, in perl_generate_script()
740 fprintf(stderr, "generated Perl script: %s\n", fname); in perl_generate_script()