From c3fff9a421ffc6bd61cbc90e3d20475ebcfe7f5e Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 27 Sep 2006 23:45:54 +0000 Subject: [PATCH] 0.6.0preX update git-svn-id: http://ltt.polymtl.ca/svn@2139 04897980-b3bd-0310-b5e0-8ef037075253 --- genevent/genevent.c | 26 +++++++++++++++----------- genevent/parser.c | 37 ++++++++++++++++++++----------------- genevent/parser.h | 1 + 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/genevent/genevent.c b/genevent/genevent.c index 8f898e7f..766e57c5 100644 --- a/genevent/genevent.c +++ b/genevent/genevent.c @@ -1401,12 +1401,14 @@ int print_event_logging_function(char *basename, facility_t *fac, fprintf(fd, "void"); } fprintf(fd,")\n"); +#if 0 fprintf(fd, - "#if (!defined(CONFIG_LTT) || !defined(CONFIG_LTT_FACILITY_%s))\n", - fac->capname); + "#if (!defined(CONFIG_LTT) || (!defined(CONFIG_LTT_FACILITY_%s) && !defined(CONFIG_LTT_FACILITY_%s_MODULE)))\n", + fac->capname, fac->capname); fprintf(fd, "{\n"); fprintf(fd, "}\n"); fprintf(fd,"#else\n"); +#endif //0 fprintf(fd, "{\n"); /* Print the function variables */ print_tabs(1, fd); @@ -1638,8 +1640,10 @@ int print_event_logging_function(char *basename, facility_t *fac, fprintf(fd, "preempt_enable_no_resched();\n"); fprintf(fd, "}\n"); - fprintf(fd, "#endif //(!defined(CONFIG_LTT) || !defined(CONFIG_LTT_FACILITY_%s))\n\n", - fac->capname); +#if 0 + fprintf(fd, "#endif //(!defined(CONFIG_LTT) || (!defined(CONFIG_LTT_FACILITY_%s) && !defined(CONFIG_LTT_FACILITY_%s_MODULE)))\n\n", + fac->capname, fac->capname); +#endif //0 return 0; } @@ -1867,7 +1871,7 @@ int print_event_logging_function_user_generic(char *basename, facility_t *fac, do_syscall: print_tabs(2, fd); - fprintf(fd, "ret = ltt_trace_generic(ltt_facility_%s_%X, event_%s_%s, buffer, reserve_size, LTT_BLOCKING);\n", fac->name, fac->checksum, fac->name, event->name); + fprintf(fd, "ret = ltt_trace_generic(ltt_facility_%s_%X, event_%s_%s, buffer, reserve_size, LTT_BLOCKING, %u);\n", fac->name, fac->checksum, fac->name, event->name, event->high_priority); print_tabs(1, fd); fprintf(fd, "}\n\n"); @@ -2167,12 +2171,12 @@ void print_log_header_head(facility_t *fac, FILE *fd) fprintf(fd, "#define _LTT_FACILITY_%s_H_\n\n", fac->capname); fprintf(fd, "#include \n"); if(!fac->arch) - fprintf(fd, "#include \n", fac->name); + fprintf(fd, "#include \n", fac->name); else - fprintf(fd, "#include \n", + fprintf(fd, "#include \n", fac->name, fac->arch); - fprintf(fd, "#include \n"); + fprintf(fd, "#include \n"); fprintf(fd, "\n"); } @@ -2496,10 +2500,10 @@ int print_loader_header(facility_t *fac) fprintf(fd, "#ifdef CONFIG_LTT\n\n"); fprintf(fd,"#include \n"); if(!fac->arch) - fprintf(fd,"#include \n\n", + fprintf(fd,"#include \n\n", fac->name); else - fprintf(fd,"#include \n\n", + fprintf(fd,"#include \n\n", fac->name, fac->arch); fprintf(fd,"ltt_facility_t\tltt_facility_%s;\n", fac->name); @@ -2561,7 +2565,7 @@ int print_loader_header_user(facility_t *fac) fprintf(fd,"#include \n\n", fac->name); else - fprintf(fd,"#include \n\n", + fprintf(fd,"#include \n\n", fac->name, fac->arch); fprintf(fd,"ltt_facility_t\tltt_facility_%s;\n", fac->name); diff --git a/genevent/parser.c b/genevent/parser.c index 2d6b27d5..0ac6f545 100644 --- a/genevent/parser.c +++ b/genevent/parser.c @@ -269,7 +269,8 @@ 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; + ev->no_instrument_function = 0; + ev->high_priority = 0; while(1) { token = getToken(in); @@ -285,28 +286,30 @@ void getEventAttributes(parse_file_t *in, event_t *ev) else if(car == '\"') ev->name = allocAndCopy(getQuotedString(in)); else ev->name = allocAndCopy(getName(in)); } else if(!strcmp("scope", token)) { - getEqual(in); - car = seekNextChar(in); - if(car == EOF) in->error(in,"scope was expected"); + getEqual(in); + car = seekNextChar(in); + if(car == EOF) in->error(in,"scope was expected"); else if(car == '\"') token = getQuotedString(in); else token = getName(in); - if(!strcmp(token, "trace")) ev->per_trace = 1; - else if(!strcmp(token, "tracefile")) ev->per_tracefile = 1; - } else if(!strcmp("param", token)) { - getEqual(in); - car = seekNextChar(in); - if(car == EOF) in->error(in,"parameter type was expected"); + if(!strcmp(token, "trace")) ev->per_trace = 1; + else if(!strcmp(token, "tracefile")) ev->per_tracefile = 1; + } else if(!strcmp("param", token)) { + getEqual(in); + car = seekNextChar(in); + if(car == EOF) in->error(in,"parameter type was expected"); else if(car == '\"') token = getQuotedString(in); else token = getName(in); - if(!strcmp(token, "buffer")) ev->param_buffer = 1; - } else if(!strcmp("attribute", token)) { - getEqual(in); - car = seekNextChar(in); - if(car == EOF) in->error(in,"attribute was expected"); + if(!strcmp(token, "buffer")) ev->param_buffer = 1; + } else if(!strcmp("attribute", token)) { + getEqual(in); + car = seekNextChar(in); + if(car == EOF) in->error(in,"attribute was expected"); else if(car == '\"') token = getQuotedString(in); else token = getName(in); - if(!strcmp(token, "no_instrument_function")) - ev->no_instrument_function = 1; + if(!strcmp(token, "no_instrument_function")) + ev->no_instrument_function = 1; + else if(!strcmp(token, "high_priority")) + ev->high_priority = 1; } } } diff --git a/genevent/parser.h b/genevent/parser.h index a447d6db..8fd75743 100644 --- a/genevent/parser.h +++ b/genevent/parser.h @@ -136,6 +136,7 @@ typedef struct _event { 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; + int high_priority; } event_t; typedef struct _facility { -- 2.34.1