From: compudj Date: Mon, 6 Mar 2006 23:44:48 +0000 (+0000) Subject: add func instrumentation X-Git-Tag: v0.12.20~1898 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4a6829e2f886c2b3aa8d9ec4e0142ef5edb390d6;p=lttv.git add func instrumentation git-svn-id: http://ltt.polymtl.ca/svn@1591 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent-new/genevent.c b/genevent-new/genevent.c index 3e48840e..b9121046 100644 --- a/genevent-new/genevent.c +++ b/genevent-new/genevent.c @@ -1588,10 +1588,16 @@ int print_event_logging_function(char *basename, facility_t *fac, int print_event_logging_function_user(char *basename, facility_t *fac, event_t *event, FILE *fd) { + char *attrib; + if(event->no_instrument_function) { + attrib = "__attribute__((no_instrument_function)) "; + } else { + attrib = ""; + } if(event->param_buffer) { - fprintf(fd, "static inline int trace_%s_param_buffer(\n", basename); + fprintf(fd, "static inline %sint trace_%s_param_buffer(\n", attrib, basename); } else { - fprintf(fd, "static inline int trace_%s(\n", basename); + fprintf(fd, "static inline %sint trace_%s(\n",attrib, basename); } int has_argument = 0; int has_type_fixed = 0; diff --git a/genevent-new/parser.c b/genevent-new/parser.c index ba331e9e..28ebaeea 100644 --- a/genevent-new/parser.c +++ b/genevent-new/parser.c @@ -248,6 +248,7 @@ void getEventAttributes(parse_file_t *in, event_t *ev) ev->per_trace = 0; ev->per_tracefile = 0; ev->param_buffer = 0; + ev->no_instrument_function = 0; while(1) { token = getToken(in); @@ -268,6 +269,8 @@ void getEventAttributes(parse_file_t *in, event_t *ev) ev->per_tracefile = 1; } else if(!strcmp("param_buffer", token)) { ev->param_buffer = 1; + } else if(!strcmp("no_instrument_function", token)) { + ev->no_instrument_function = 1; } } diff --git a/genevent-new/parser.h b/genevent-new/parser.h index 7c579e00..ec360f84 100644 --- a/genevent-new/parser.h +++ b/genevent-new/parser.h @@ -135,6 +135,7 @@ typedef struct _event { int per_trace; /* Is the event able to be logged to a specific trace ? */ int per_tracefile; /* Must we log this event in a specific tracefile ? */ int param_buffer; /* For userspace tracing : takes a buffer as parameter? */ + int no_instrument_function; } event_t; typedef struct _facility {