Home | History | Annotate | Download | only in scripting-engines

Lines Matching refs:ofp

464 	FILE *ofp;
467 ofp = fopen(fname, "w");
468 if (ofp == NULL) {
473 fprintf(ofp, "# perf script event handlers, "
476 fprintf(ofp, "# Licensed under the terms of the GNU GPL"
479 fprintf(ofp, "# The common_* event handler fields are the most useful "
482 fprintf(ofp, "# all events. They don't necessarily correspond to "
485 fprintf(ofp, "# in the format files. Those fields not available as "
488 fprintf(ofp, "# be retrieved using Perl functions of the form "
491 fprintf(ofp, "# See Context.pm for the list of available "
494 fprintf(ofp, "use lib \"$ENV{'PERF_EXEC_PATH'}/scripts/perl/"
497 fprintf(ofp, "use lib \"./Perf-Trace-Util/lib\";\n");
498 fprintf(ofp, "use Perf::Trace::Core;\n");
499 fprintf(ofp, "use Perf::Trace::Context;\n");
500 fprintf(ofp, "use Perf::Trace::Util;\n\n");
502 fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n");
503 fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n\n");
506 fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name);
507 fprintf(ofp, "\tmy (");
509 fprintf(ofp, "$event_name, ");
510 fprintf(ofp, "$context, ");
511 fprintf(ofp, "$common_cpu, ");
512 fprintf(ofp, "$common_secs, ");
513 fprintf(ofp, "$common_nsecs,\n");
514 fprintf(ofp, "\t $common_pid, ");
515 fprintf(ofp, "$common_comm,\n\t ");
522 fprintf(ofp, ", ");
524 fprintf(ofp, "\n\t ");
526 fprintf(ofp, "$%s", f->name);
528 fprintf(ofp, ") = @_;\n\n");
530 fprintf(ofp, "\tprint_header($event_name, $common_cpu, "
534 fprintf(ofp, "\tprintf(\"");
541 fprintf(ofp, ", ");
543 fprintf(ofp, "\".\n\t \"");
547 fprintf(ofp, "%s=", f->name);
551 fprintf(ofp, "%%s");
553 fprintf(ofp, "%%d");
555 fprintf(ofp, "%%u");
558 fprintf(ofp, "\\n\",\n\t ");
565 fprintf(ofp, ", ");
568 fprintf(ofp, "\n\t ");
572 fprintf(ofp, "\n\t ");
575 fprintf(ofp, "flag_str(\"");
576 fprintf(ofp, "%s::%s\", ", event->system,
578 fprintf(ofp, "\"%s\", $%s)", f->name,
582 fprintf(ofp, "\n\t ");
585 fprintf(ofp, "symbol_str(\"");
586 fprintf(ofp, "%s::%s\", ", event->system,
588 fprintf(ofp, "\"%s\", $%s)", f->name,
591 fprintf(ofp, "$%s", f->name);
594 fprintf(ofp, ");\n");
595 fprintf(ofp, "}\n\n");
598 fprintf(ofp, "sub trace_unhandled\n{\n\tmy ($event_name, $context, "
602 fprintf(ofp, "\tprint_header($event_name, $common_cpu, "
606 fprintf(ofp, "sub print_header\n{\n"
611 fprintf(ofp,
632 fclose(ofp);