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

Lines Matching refs:ofp

549 	FILE *ofp;
552 ofp = fopen(fname, "w");
553 if (ofp == NULL) {
557 fprintf(ofp, "# perf script event handlers, "
560 fprintf(ofp, "# Licensed under the terms of the GNU GPL"
563 fprintf(ofp, "# The common_* event handler fields are the most useful "
566 fprintf(ofp, "# all events. They don't necessarily correspond to "
569 fprintf(ofp, "# in the format files. Those fields not available as "
572 fprintf(ofp, "# be retrieved using Python functions of the form "
575 fprintf(ofp, "# See the perf-trace-python Documentation for the list "
578 fprintf(ofp, "import os\n");
579 fprintf(ofp, "import sys\n\n");
581 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n");
582 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n");
583 fprintf(ofp, "\nfrom perf_trace_context import *\n");
584 fprintf(ofp, "from Core import *\n\n\n");
586 fprintf(ofp, "def trace_begin():\n");
587 fprintf(ofp, "\tprint \"in trace_begin\"\n\n");
589 fprintf(ofp, "def trace_end():\n");
590 fprintf(ofp, "\tprint \"in trace_end\"\n\n");
593 fprintf(ofp, "def %s__%s(", event->system, event->name);
594 fprintf(ofp, "event_name, ");
595 fprintf(ofp, "context, ");
596 fprintf(ofp, "common_cpu,\n");
597 fprintf(ofp, "\tcommon_secs, ");
598 fprintf(ofp, "common_nsecs, ");
599 fprintf(ofp, "common_pid, ");
600 fprintf(ofp, "common_comm,\n\t");
607 fprintf(ofp, ", ");
609 fprintf(ofp, "\n\t");
611 fprintf(ofp, "%s", f->name);
613 fprintf(ofp, "):\n");
615 fprintf(ofp
619 fprintf(ofp, "\t\tprint \"");
626 fprintf(ofp, ", ");
628 fprintf(ofp, "\" \\\n\t\t\"");
632 fprintf(ofp, "%s=", f->name);
636 fprintf(ofp, "%%s");
638 fprintf(ofp, "%%d");
640 fprintf(ofp, "%%u");
643 fprintf(ofp, "\\n\" %% \\\n\t\t(");
650 fprintf(ofp, ", ");
653 fprintf(ofp, "\n\t\t");
657 fprintf(ofp, "\n\t\t");
660 fprintf(ofp, "flag_str(\"");
661 fprintf(ofp, "%s__%s\", ", event->system,
663 fprintf(ofp, "\"%s\", %s)", f->name,
667 fprintf(ofp, "\n\t\t");
670 fprintf(ofp, "symbol_str(\"");
671 fprintf(ofp, "%s__%s\", ", event->system,
673 fprintf(ofp, "\"%s\", %s)", f->name,
676 fprintf(ofp, "%s", f->name);
679 fprintf(ofp, "),\n\n");
682 fprintf(ofp, "def trace_unhandled(event_name, context, "
685 fprintf(ofp, "\t\tprint ' '.join(['%%s=%%s'%%(k,str(v))"
688 fprintf(ofp, "def print_header("
693 fclose(ofp);