+++ /dev/null
-<facility name=s390_kernel>
- <description>The kernel facility has events related to kernel execution status.</description>
-
- <event name=trap_entry>
- <description>Entry in a trap</description>
- <struct>
- <field name="trap_id"> <description>Trap number</description> <uint size=8/> </field>
- <field name="address"> <description>Address where trap occured</description> <pointer/> </field>
- </struct>
- </event>
-
-</facility>
--- /dev/null
+<facility name=s390_kernel>
+ <description>The kernel facility has events related to kernel execution status.</description>
+
+ <event name=trap_entry>
+ <description>Entry in a trap</description>
+ <struct>
+ <field name="trap_id"> <description>Trap number</description> <uint size=8/> </field>
+ <field name="address"> <description>Address where trap occured</description> <pointer/> </field>
+ </struct>
+ </event>
+
+</facility>
* 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.
****************************************************************************/
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;
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",
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;
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);
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;
}
/* 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
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;
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;