[svn:parrot] r42982 - in trunk: . docs/dev include/parrot src/runcore

cotto at svn.parrot.org cotto at svn.parrot.org
Fri Dec 11 08:29:12 UTC 2009


Author: cotto
Date: Fri Dec 11 08:29:12 2009
New Revision: 42982
URL: https://trac.parrot.org/parrot/changeset/42982

Log:
[profiling] add stub documentation and configuration support for annotations

Added:
   trunk/docs/dev/profiling.pod   (contents, props changed)
Modified:
   trunk/MANIFEST
   trunk/include/parrot/runcore_profiling.h
   trunk/src/runcore/profiling.c

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Fri Dec 11 08:11:35 2009	(r42981)
+++ trunk/MANIFEST	Fri Dec 11 08:29:12 2009	(r42982)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Dec 10 05:38:29 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Dec 11 08:24:26 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -464,6 +464,7 @@
 docs/dev/pccmethods.pod                                     []
 docs/dev/pmc_freeze.pod                                     []
 docs/dev/pmc_obj_design_meeting_notes.pod                   []
+docs/dev/profiling.pod                                      []
 docs/embed.pod                                              []
 docs/extend.pod                                             []
 docs/faq.pod                                                [main]doc

Added: trunk/docs/dev/profiling.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/docs/dev/profiling.pod	Fri Dec 11 08:29:12 2009	(r42982)
@@ -0,0 +1,16 @@
+# Copyright (C) 2001-2005, Parrot Foundation.
+# $Id$
+
+=head1 Name
+
+docs/dev/profiling.pod - Profiling Parrot
+
+=head1 Description
+
+This file documents the use of Parrot's profiling runcore.
+
+=head2 Summary
+
+It does some stuff.
+
+=cut

Modified: trunk/include/parrot/runcore_profiling.h
==============================================================================
--- trunk/include/parrot/runcore_profiling.h	Fri Dec 11 08:11:35 2009	(r42981)
+++ trunk/include/parrot/runcore_profiling.h	Fri Dec 11 08:29:12 2009	(r42982)
@@ -24,9 +24,11 @@
 #endif
 
 typedef enum Parrot_profiling_flags {
-    PROFILING_EXIT_CHECK_FLAG       = 1 << 0,
-    PROFILING_FIRST_LOOP_FLAG       = 1 << 1,
-    PROFILING_HAVE_PRINTED_CLI_FLAG = 1 << 2
+    PROFILING_EXIT_CHECK_FLAG         = 1 << 0,
+    PROFILING_FIRST_LOOP_FLAG         = 1 << 1,
+    PROFILING_HAVE_PRINTED_CLI_FLAG   = 1 << 2,
+    PROFILING_REPORT_ANNOTATIONS_FLAG = 1 << 3
+
 } Parrot_profiling_flags;
 
 typedef enum Parrot_profiling_line {
@@ -121,6 +123,13 @@
 #define Profiling_have_printed_cli_CLEAR(o) \
     Profiling_flag_CLEAR(o, PROFILING_HAVE_PRINTED_CLI_FLAG)
 
+#define Profiling_report_annotations_TEST(o) \
+    Profiling_flag_TEST(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+#define Profiling_report_annotations_SET(o) \
+    Profiling_flag_SET(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+#define Profiling_report_annotations_CLEAR(o) \
+    Profiling_flag_CLEAR(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+
 /* HEADERIZER BEGIN: src/runcore/profiling.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 

Modified: trunk/src/runcore/profiling.c
==============================================================================
--- trunk/src/runcore/profiling.c	Fri Dec 11 08:11:35 2009	(r42981)
+++ trunk/src/runcore/profiling.c	Fri Dec 11 08:29:12 2009	(r42982)
@@ -136,7 +136,7 @@
 {
     ASSERT_ARGS(init_profiling_core)
 
-    char *profile_filename, *output_cstr, *filename_cstr;
+    char *profile_filename, *output_cstr, *filename_cstr, *annotations_cstr;
 
     /* initialize the runcore struct */
     runcore->runops  = (Parrot_runcore_runops_fn_t)  runops_profiling_core;
@@ -207,6 +207,14 @@
         runcore->output_fn = record_values_ascii_pprof;
     }
 
+    /* figure out if annotations are wanted */
+    annotations_cstr = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_PROFILING_ANNOTATIONS"));
+
+    if (annotations_cstr) {
+        mem_sys_free(annotations_cstr);
+        Profiling_report_annotations_SET(runcore);
+    }
+
     /* put profile_filename in the gc root set so it won't get collected */
     gc_register_pmc(interp, (PMC *) runcore->profile_filename);
 


More information about the parrot-commits mailing list