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

Lines Matching refs:ofp

442 	FILE *ofp;
445 ofp = fopen(fname, "w");
446 if (ofp == NULL) {
450 fprintf(ofp, "# perf script event handlers, "
453 fprintf(ofp, "# Licensed under the terms of the GNU GPL"
456 fprintf(ofp, "# The common_* event handler fields are the most useful "
459 fprintf(ofp, "# all events. They don't necessarily correspond to "
462 fprintf(ofp, "# in the format files. Those fields not available as "
465 fprintf(ofp, "# be retrieved using Python functions of the form "
468 fprintf(ofp, "# See the perf-trace-python Documentation for the list "
471 fprintf(ofp, "import os\n");
472 fprintf(ofp, "import sys\n\n");
474 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n");
475 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n");
476 fprintf(ofp, "\nfrom perf_trace_context import *\n");
477 fprintf(ofp, "from Core import *\n\n\n");
479 fprintf(ofp, "def trace_begin():\n");
480 fprintf(ofp, "\tprint \"in trace_begin\"\n\n");
482 fprintf(ofp, "def trace_end():\n");
483 fprintf(ofp, "\tprint \"in trace_end\"\n\n");
486 fprintf(ofp, "def %s__%s(", event->system, event->name);
487 fprintf(ofp, "event_name, ");
488 fprintf(ofp, "context, ");
489 fprintf(ofp, "common_cpu,\n");
490 fprintf(ofp, "\tcommon_secs, ");
491 fprintf(ofp, "common_nsecs, ");
492 fprintf(ofp, "common_pid, ");
493 fprintf(ofp, "common_comm,\n\t");
500 fprintf(ofp, ", ");
502 fprintf(ofp, "\n\t");
504 fprintf(ofp, "%s", f->name);
506 fprintf(ofp, "):\n");
508 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, "
512 fprintf(ofp, "\t\tprint \"");
519 fprintf(ofp, ", ");
521 fprintf(ofp, "\" \\\n\t\t\"");
525 fprintf(ofp, "%s=", f->name);
529 fprintf(ofp, "%%s");
531 fprintf(ofp, "%%d");
533 fprintf(ofp, "%%u");
536 fprintf(ofp, "\\n\" %% \\\n\t\t(");
543 fprintf(ofp, ", ");
546 fprintf(ofp, "\n\t\t");
550 fprintf(ofp, "\n\t\t");
553 fprintf(ofp, "flag_str(\"");
554 fprintf(ofp, "%s__%s\", ", event->system,
556 fprintf(ofp, "\"%s\", %s)", f->name,
560 fprintf(ofp, "\n\t\t");
563 fprintf(ofp, "symbol_str(\"");
564 fprintf(ofp, "%s__%s\", ", event->system,
566 fprintf(ofp, "\"%s\", %s)", f->name,
569 fprintf(ofp, "%s", f->name);
572 fprintf(ofp, "),\n\n");
575 fprintf(ofp, "def trace_unhandled(event_name, context, "
578 fprintf(ofp, "\t\tprint ' '.join(['%%s=%%s'%%(k,str(v))"
581 fprintf(ofp, "def print_header("
586 fclose(ofp);