From: compudj Date: Thu, 8 Sep 2005 14:12:45 +0000 (+0000) Subject: make LTTV support the facility.xml in eventdefs : multiple facilities found by checksum X-Git-Tag: v0.12.20~2327 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=29e7c5b37d76ef85f8d0bebbe3d453c9a14e0d3f;p=lttv.git make LTTV support the facility.xml in eventdefs : multiple facilities found by checksum git-svn-id: http://ltt.polymtl.ca/svn@1162 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/facilities/s390-kernel.xml b/ltt/branches/poly/facilities/s390-kernel.xml deleted file mode 100644 index 8334c9d6..00000000 --- a/ltt/branches/poly/facilities/s390-kernel.xml +++ /dev/null @@ -1,12 +0,0 @@ - - The kernel facility has events related to kernel execution status. - - - Entry in a trap - - Trap number - Address where trap occured - - - - diff --git a/ltt/branches/poly/facilities/s390_kernel.xml b/ltt/branches/poly/facilities/s390_kernel.xml new file mode 100644 index 00000000..8334c9d6 --- /dev/null +++ b/ltt/branches/poly/facilities/s390_kernel.xml @@ -0,0 +1,12 @@ + + The kernel facility has events related to kernel execution status. + + + Entry in a trap + + Trap number + Address where trap occured + + + + diff --git a/ltt/branches/poly/ltt/facility.c b/ltt/branches/poly/ltt/facility.c index 0da437c3..5b2c8ba4 100644 --- a/ltt/branches/poly/ltt/facility.c +++ b/ltt/branches/poly/ltt/facility.c @@ -69,6 +69,8 @@ void freeLttNamedType(LttType * type); * t : the trace containing the facilities * pathname : the path name of the facility * + * Open the facility corresponding to the right checksum. + * *returns 0 on success, 1 on error. ****************************************************************************/ @@ -79,8 +81,8 @@ int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname) parse_file_t in; facility_t * fac; unsigned long checksum; - //GError * error = NULL; gchar buffer[BUFFER_SIZE]; + gboolean generated = FALSE; in.buffer = &(buffer[0]); in.lineno = 0; @@ -88,8 +90,6 @@ int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname) in.name = pathname; in.unget = 0; - //in.fd = g_open(in.name, O_RDONLY, 0); - //if(in.fd < 0 ) { in.fp = fopen(in.name, "r"); if(in.fp == NULL) { g_warning("cannot open facility description file %s", @@ -98,9 +98,6 @@ int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname) goto open_error; } - //in.channel = g_io_channel_unix_new(in.fd); - //in.pos = 0; - while(1){ token = getToken(&in); if(in.type == ENDFILE) break; @@ -122,8 +119,11 @@ int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname) checkNamedTypesImplemented(&fac->named_types); generateChecksum(fac->name, &checksum, &fac->events); - - generateFacility(f, fac, checksum); + + if(checksum == f->checksum) { + generateFacility(f, fac, checksum); + generated = TRUE; + } g_free(fac->name); free(fac->capname); @@ -142,17 +142,14 @@ int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname) goto parse_error; } } - + parse_error: - //g_io_channel_shutdown(in.channel, FALSE, &error); /* No flush */ - //if(error != NULL) { fclose(in.fp); open_error: - // g_warning("Can not close file: \n%s\n", error->message); - // g_error_free(error); - //} - //g_close(in.fd); + if(!generated) + g_warning("Cannot find facility %s, checksum 0x%X", f->name, f->checksum); + return ret; } diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 144ee8cf..b9ab0b71 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -804,7 +804,7 @@ static int open_tracefiles(LttTrace *trace, gchar *root_path, /* ltt_get_facility_description * - * Opens the trace corresponding to the requested facility (identified by fac_id + * Opens the file corresponding to the requested facility (identified by fac_id * and checksum). * * The name searched is : %trace root%/eventdefs/facname_checksum.xml @@ -836,7 +836,7 @@ static int ltt_get_facility_description(LttFacility *f, textlen+=strlen(text); if(textlen >= PATH_MAX) goto name_error; strcat(desc_file_name, text); - +#if 0 text = "_"; textlen+=strlen(text); if(textlen >= PATH_MAX) goto name_error; @@ -848,11 +848,12 @@ static int ltt_get_facility_description(LttFacility *f, textlen=strlen(desc_file_name); +#endif //0 text = ".xml"; textlen+=strlen(text); if(textlen >= PATH_MAX) goto name_error; strcat(desc_file_name, text); - + err = ltt_facility_open(f, t, desc_file_name); if(err) goto facility_error;