Lines Matching refs:ofp
551 FILE *ofp; in perl_generate_script() local
554 ofp = fopen(fname, "w"); in perl_generate_script()
555 if (ofp == NULL) { in perl_generate_script()
560 fprintf(ofp, "# perf script event handlers, " in perl_generate_script()
563 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in perl_generate_script()
566 fprintf(ofp, "# The common_* event handler fields are the most useful " in perl_generate_script()
569 fprintf(ofp, "# all events. They don't necessarily correspond to " in perl_generate_script()
572 fprintf(ofp, "# in the format files. Those fields not available as " in perl_generate_script()
575 fprintf(ofp, "# be retrieved using Perl functions of the form " in perl_generate_script()
578 fprintf(ofp, "# See Context.pm for the list of available " in perl_generate_script()
581 fprintf(ofp, "use lib \"$ENV{'PERF_EXEC_PATH'}/scripts/perl/" in perl_generate_script()
584 fprintf(ofp, "use lib \"./Perf-Trace-Util/lib\";\n"); in perl_generate_script()
585 fprintf(ofp, "use Perf::Trace::Core;\n"); in perl_generate_script()
586 fprintf(ofp, "use Perf::Trace::Context;\n"); in perl_generate_script()
587 fprintf(ofp, "use Perf::Trace::Util;\n\n"); in perl_generate_script()
589 fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n"); in perl_generate_script()
590 fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n"); in perl_generate_script()
593 fprintf(ofp, "\n\ in perl_generate_script()
616 fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name); in perl_generate_script()
617 fprintf(ofp, "\tmy ("); in perl_generate_script()
619 fprintf(ofp, "$event_name, "); in perl_generate_script()
620 fprintf(ofp, "$context, "); in perl_generate_script()
621 fprintf(ofp, "$common_cpu, "); in perl_generate_script()
622 fprintf(ofp, "$common_secs, "); in perl_generate_script()
623 fprintf(ofp, "$common_nsecs,\n"); in perl_generate_script()
624 fprintf(ofp, "\t $common_pid, "); in perl_generate_script()
625 fprintf(ofp, "$common_comm, "); in perl_generate_script()
626 fprintf(ofp, "$common_callchain,\n\t "); in perl_generate_script()
633 fprintf(ofp, ", "); in perl_generate_script()
635 fprintf(ofp, "\n\t "); in perl_generate_script()
637 fprintf(ofp, "$%s", f->name); in perl_generate_script()
639 fprintf(ofp, ") = @_;\n\n"); in perl_generate_script()
641 fprintf(ofp, "\tprint_header($event_name, $common_cpu, " in perl_generate_script()
645 fprintf(ofp, "\tprintf(\""); in perl_generate_script()
652 fprintf(ofp, ", "); in perl_generate_script()
654 fprintf(ofp, "\".\n\t \""); in perl_generate_script()
658 fprintf(ofp, "%s=", f->name); in perl_generate_script()
662 fprintf(ofp, "%%s"); in perl_generate_script()
664 fprintf(ofp, "%%d"); in perl_generate_script()
666 fprintf(ofp, "%%u"); in perl_generate_script()
669 fprintf(ofp, "\\n\",\n\t "); in perl_generate_script()
676 fprintf(ofp, ", "); in perl_generate_script()
679 fprintf(ofp, "\n\t "); in perl_generate_script()
683 fprintf(ofp, "\n\t "); in perl_generate_script()
686 fprintf(ofp, "flag_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()
693 fprintf(ofp, "\n\t "); in perl_generate_script()
696 fprintf(ofp, "symbol_str(\""); in perl_generate_script()
697 fprintf(ofp, "%s::%s\", ", event->system, in perl_generate_script()
699 fprintf(ofp, "\"%s\", $%s)", f->name, in perl_generate_script()
702 fprintf(ofp, "$%s", f->name); in perl_generate_script()
705 fprintf(ofp, ");\n\n"); in perl_generate_script()
707 fprintf(ofp, "\tprint_backtrace($common_callchain);\n"); in perl_generate_script()
709 fprintf(ofp, "}\n\n"); in perl_generate_script()
712 fprintf(ofp, "sub trace_unhandled\n{\n\tmy ($event_name, $context, " in perl_generate_script()
716 fprintf(ofp, "\tprint_header($event_name, $common_cpu, " in perl_generate_script()
719 fprintf(ofp, "\tprint_backtrace($common_callchain);\n"); in perl_generate_script()
720 fprintf(ofp, "}\n\n"); in perl_generate_script()
722 fprintf(ofp, "sub print_header\n{\n" in perl_generate_script()
727 fprintf(ofp, in perl_generate_script()
748 fclose(ofp); in perl_generate_script()