remove autogenerated files
[lttv.git] / genevent-new / genevent.c
index 1f9a5e09fc4cbd8224c6292fd2dc242c9ebf8ae0..aba40e528d204b411c2dcef8c54ec93d245b85e7 100644 (file)
@@ -224,87 +224,87 @@ int print_arg(type_descriptor_t * td, FILE *fd, unsigned int tabs,
        switch(td->type) {
                case INT_FIXED:
                        fprintf(fd, "%s", intOutputTypes[getSizeindex(td->size)]);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, "lttng_param_%s", field_name);
                        break;
                case UINT_FIXED:
                        fprintf(fd, "%s", uintOutputTypes[getSizeindex(td->size)]);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, "lttng_param_%s", field_name);
                        break;
                case CHAR:
                        fprintf(fd, "signed char");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case UCHAR:
                        fprintf(fd, "unsigned char");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case SHORT:
                        fprintf(fd, "short");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case USHORT:
                        fprintf(fd, "unsigned short");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case INT:
                        fprintf(fd, "int");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case UINT:
                        fprintf(fd, "unsigned int");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case FLOAT:
                        fprintf(fd, "%s", floatOutputTypes[getSizeindex(td->size)]);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case POINTER:
                        fprintf(fd, "const void *");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case LONG:
                        fprintf(fd, "long");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case ULONG:
                        fprintf(fd, "unsigned long");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case SIZE_T:
                        fprintf(fd, "size_t");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case SSIZE_T:
                        fprintf(fd, "ssize_t");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case OFF_T:
                        fprintf(fd, "off_t");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case STRING:
                        fprintf(fd, "const char *");
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case ENUM:
                        fprintf(fd, "enum lttng_%s", basename);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case ARRAY:
                        fprintf(fd, "lttng_array_%s", basename);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
                case SEQUENCE:
                        fprintf(fd, "lttng_sequence_%s *", basename);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
        case STRUCT:
                        fprintf(fd, "struct lttng_%s *", basename);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
        case UNION:
                        fprintf(fd, "union lttng_%s *", basename);
-                       fprintf(fd, " %s", field_name);
+                       fprintf(fd, " lttng_param_%s", field_name);
                        break;
        default:
                        printf("print_type : unknown type\n");
@@ -411,7 +411,8 @@ int print_type_declaration(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                        fprintf(fd, " {\n");
                        for(unsigned int i=0;i<td->labels.position;i++){
                                print_tabs(1, fd);
-                               fprintf(fd, "LTTNG_%s", ((char*)(td->labels.array[i])));
+                               fprintf(fd, "LTTNG_%s = %d", ((char*)td->labels.array[i]),
+            (*(int*)td->labels_values.array[i]));
                                fprintf(fd, ",\n");
                        }
                        fprintf(fd, "};\n");
@@ -574,6 +575,27 @@ int print_type_alignment(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                        case STRING:
                                fprintf(fd, "sizeof(char)");
                                break;
+                       case INT_FIXED:
+                       case UINT_FIXED:
+                       case CHAR:
+                       case UCHAR:
+                       case SHORT:
+                       case USHORT:
+                       case INT:
+                       case UINT:
+                       case FLOAT:
+                       case POINTER:
+                       case LONG:
+                       case ULONG:
+                       case SIZE_T:
+                       case SSIZE_T:
+                       case OFF_T:
+                       case ENUM:
+                               fprintf(fd, "sizeof(");
+                               if(print_type(td, fd, 0, basename, "")) return 1;
+                               fprintf(fd, ")");
+                               break;
+
                        default:
                                printf("error : type unexpected\n");
                                return 1;
@@ -686,14 +708,28 @@ int print_type_write(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                case OFF_T:
                case ENUM:
                        print_tabs(tabs, fd);
-                       fprintf(fd, "size = ");
+                       fprintf(fd, "align = ");
+                       if(print_type_alignment(td, fd, 0, basename, "", "obj")) return 1;
+                       fprintf(fd, ";\n");
+                       fprintf(fd, "\n");
+                       print_tabs(tabs, fd);
+                       fprintf(fd, "if(*len == 0) {\n");
+                       print_tabs(tabs+1, fd);
+                       fprintf(fd, "*to += ltt_align(*to, align); /* align output */\n");
+                       print_tabs(tabs, fd);
+                       fprintf(fd, "} else {\n");
+                       print_tabs(tabs+1, fd);
+                       fprintf(fd, "*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */\n");
+                       print_tabs(tabs, fd);
+                       fprintf(fd, "}\n");
+                       fprintf(fd, "\n");
+
+                       print_tabs(tabs, fd);
+                       fprintf(fd, "*len += ");
                        fprintf(fd, "sizeof(");
                        if(print_type(td, fd, 0, basename, "")) return 1;
                        fprintf(fd, ");\n");
-                       print_tabs(tabs, fd);
-                       fprintf(fd, "size += ltt_align(*to+*len, size) + size;\n");
-                       print_tabs(tabs, fd);
-                       fprintf(fd, "*len += size;");
+
                        break;
                case STRING:
                        print_tabs(tabs, fd);
@@ -734,6 +770,51 @@ int print_type_write(type_descriptor_t * td, FILE *fd, unsigned int tabs,
        return 0;
 }
 
+/* print need local vars ?.
+ *
+ * Copied from print_type_write
+ *
+ * Does the type_write call needs local size and from variables ?
+ * return value : 1 yes, 0 no.
+ */
+
+int has_type_local(type_descriptor_t * td)
+{
+       switch(td->type) {
+               case INT_FIXED:
+               case UINT_FIXED:
+               case CHAR:
+               case UCHAR:
+               case SHORT:
+               case USHORT:
+               case INT:
+               case UINT:
+               case FLOAT:
+               case POINTER:
+               case LONG:
+               case ULONG:
+               case SIZE_T:
+               case SSIZE_T:
+               case OFF_T:
+               case ENUM:
+                       return 1;
+                       break;
+               case STRING:
+               case SEQUENCE:
+               case STRUCT:
+               case UNION:
+               case ARRAY:
+                       return 0;
+                       break;
+               case NONE:
+                       printf("Error : type NONE unexpected\n");
+                       return 1;
+                       break;
+       }
+
+       return 0;
+}
+
 
 
 /* print type alignment function.
@@ -986,8 +1067,18 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
        }
 
        fprintf(fd, "{\n");
+
+       switch(td->type) {
+               case STRING:
+                       print_tabs(1, fd);
+                       fprintf(fd, "size_t size;\n");
+                       break;
+               default:
+                       break;
+       }
+
        print_tabs(1, fd);
-       fprintf(fd, "size_t align, size;\n");
+       fprintf(fd, "size_t align;\n");
        fprintf(fd, "\n");
 
        switch(td->type) {
@@ -1042,11 +1133,9 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                fprintf(fd, "/* Contains only fixed size fields : use compiler sizeof() */\n");
                fprintf(fd, "\n");
                print_tabs(1, fd);
-               fprintf(fd, "size = sizeof(");
+               fprintf(fd, "*len += sizeof(");
                if(print_type(td, fd, 0, basename, field_name)) return 1;
                fprintf(fd, ");\n");
-               print_tabs(1, fd);
-               fprintf(fd, "*len += size;\n");
        } else {
                /* The type contains nested variable size subtypes :
                 * we must write field by field. */
@@ -1069,29 +1158,37 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                                print_tabs(1, fd);
                                fprintf(fd, "if(buffer != NULL)\n");
                                print_tabs(2, fd);
-                               fprintf(fd, "memcpy(buffer+*to_base+*to, &obj->len, size);\n");
+                               fprintf(fd, "memcpy(buffer+*to_base+*to, &obj->len, *len);\n");
                                print_tabs(1, fd);
-                               fprintf(fd, "*to += size;\n");
+                               fprintf(fd, "*to += *len;\n");
+                               print_tabs(1, fd);
+                               fprintf(fd, "*len = 0;\n");
                                fprintf(fd, "\n");
-                               
+
                                /* Write the child : varlen child or not ? */
                                if(has_type_fixed_size(((field_t*)td->fields.array[1])->type)) {
                                        /* Fixed size len child : use a multiplication of its size */
 //                                     print_tabs(1, fd);
 //                                     fprintf(fd, "size = sizeof(\n");
+
+                                       //print_tabs(1, fd);
+                                       /* We know that *len does not contain alignment because of the
+                                        * previous align output. len is always 0 here. */
                                        if(print_type_write(((field_t*)td->fields.array[1])->type,
-                                                       fd, 1, basename, "array[0]", "obj->", 1)) return 1;
+                                                       fd, 1, basename, "array[0]", "obj->", 1))
+                                               return 1;
 //                                     fprintf(fd, ");\n");
-//                                     print_tabs(1, fd);
-                                       fprintf(fd, "*to += ltt_align(*to, size);\n");
+                                       fprintf(fd, "\n");
                                        print_tabs(1, fd);
-                                       fprintf(fd, "size = obj->len * size;\n");
+                                       fprintf(fd, "*len = obj->len * (*len);\n");
                                        print_tabs(1, fd);
                                        fprintf(fd, "if(buffer != NULL)\n");
                                        print_tabs(2, fd);
-                                       fprintf(fd, "memcpy(buffer+*to_base+*to, obj->array, size);\n");
+                                       fprintf(fd, "memcpy(buffer+*to_base+*to, obj->array, *len);\n");
                                        print_tabs(1, fd);
-                                       fprintf(fd, "*to += size;\n");
+                                       fprintf(fd, "*to += *len;\n");
+                                       print_tabs(1, fd);
+                                       fprintf(fd, "*len = 0;\n");
                                        fprintf(fd, "\n");
                                } else {
                                        print_tabs(1, fd);
@@ -1107,7 +1204,7 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                                print_tabs(1, fd);
                                fprintf(fd, "/* Realign the *to_base on arch size, set *to to 0 */\n");
                                print_tabs(1, fd);
-                               fprintf(fd, "*to = ltt_align(*to, sizeof(void *));\n");
+                               fprintf(fd, "*to += ltt_align(*to, sizeof(void *));\n");
                                print_tabs(1, fd);
                                fprintf(fd, "*to_base = *to_base+*to;\n");
                                print_tabs(1, fd);
@@ -1131,7 +1228,7 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                                print_tabs(1, fd);
                                fprintf(fd, "/* Realign the *to_base on arch size, set *to to 0 */\n");
                                print_tabs(1, fd);
-                               fprintf(fd, "*to = ltt_align(*to, sizeof(void *));\n");
+                               fprintf(fd, "*to += ltt_align(*to, sizeof(void *));\n");
                                print_tabs(1, fd);
                                fprintf(fd, "*to_base = *to_base+*to;\n");
                                print_tabs(1, fd);
@@ -1195,6 +1292,7 @@ int print_event_logging_function(char *basename, facility_t *fac,
 {
        fprintf(fd, "static inline void trace_%s(\n", basename);
        int     has_argument = 0;
+       int has_type_fixed = 0;
 
   /* Does it support per trace tracing ? */
   if(event->per_trace) {
@@ -1256,10 +1354,6 @@ int print_event_logging_function(char *basename, facility_t *fac,
        print_tabs(1, fd);
        fprintf(fd, "size_t *to = &real_to;\n");
        print_tabs(1, fd);
-       fprintf(fd, "const void *real_from;\n");
-       print_tabs(1, fd);
-       fprintf(fd, "const void **from = &real_from;\n");
-       print_tabs(1, fd);
        fprintf(fd, "size_t real_len = 0;\n");
        print_tabs(1, fd);
        fprintf(fd, "size_t *len = &real_len;\n");
@@ -1268,8 +1362,27 @@ int print_event_logging_function(char *basename, facility_t *fac,
        print_tabs(1, fd);
        fprintf(fd, "size_t slot_size;\n");
        print_tabs(1, fd);
-       fprintf(fd, "size_t size;\n");
-       print_tabs(1, fd);
+
+       if(event->fields.position > 0) {
+               for(unsigned int i=0;i<event->fields.position;i++){
+                       /* Search for at least one child with fixed size. It means
+                        * we need local variables.*/
+                       field_t *field = (field_t*)(event->fields.array[i]);
+                       type_descriptor_t *type = field->type;
+                       has_type_fixed = has_type_local(type);
+                       if(has_type_fixed) break;
+               }
+               
+               if(has_type_fixed) {
+                       fprintf(fd, "size_t align;\n");
+                       print_tabs(1, fd);
+               }
+
+               fprintf(fd, "const void *real_from;\n");
+               print_tabs(1, fd);
+               fprintf(fd, "const void **from = &real_from;\n");
+               print_tabs(1, fd);
+       }
        fprintf(fd, "cycles_t tsc;\n");
        print_tabs(1, fd);
        fprintf(fd, "size_t before_hdr_pad, after_hdr_pad, header_size;\n");
@@ -1305,22 +1418,19 @@ int print_event_logging_function(char *basename, facility_t *fac,
                        case ARRAY:
                        case STRUCT:
                        case STRING:
-                               fprintf(fd, "*from = %s;\n", field->name);
+                               fprintf(fd, "*from = lttng_param_%s;\n", field->name);
                                break;
                        default:
-                               fprintf(fd, "*from = &%s;\n", field->name);
+                               fprintf(fd, "*from = &lttng_param_%s;\n", field->name);
                                break;
                }
 
                if(print_type_write(type,
-                               fd, 1, basename, field->name, "", 0)) return 1;
+                               fd, 1, basename, field->name, "lttng_param_", 0)) return 1;
                fprintf(fd, "\n");
        }
        print_tabs(1, fd);
        fprintf(fd, "reserve_size = *to_base + *to + *len;\n");
-       print_tabs(1, fd);
-       fprintf(fd, "*to_base = *to = *len = 0;\n");
-       fprintf(fd, "\n");
 
        /* Take locks : make sure the trace does not vanish while we write on
         * it. A simple preemption disabling is enough (using rcu traces). */
@@ -1375,7 +1485,14 @@ int print_event_logging_function(char *basename, facility_t *fac,
        fprintf(fd, "&before_hdr_pad, &after_hdr_pad, &header_size);\n");
        /* If error, return */
        print_tabs(2, fd);
-       fprintf(fd, "if(!buffer) return;\n\n");
+       fprintf(fd, "if(!buffer) continue; /* buffer full */\n\n");
+       //print_tabs(2, fd);
+       // for DEBUG only 
+       // fprintf(fd, "goto commit; /* DEBUG : never actually write. */\n\n");
+       print_tabs(2, fd);
+       fprintf(fd, "*to_base = *to = *len = 0;\n");
+       fprintf(fd, "\n");
+
        /* Write event header */
        print_tabs(2, fd);
        fprintf(fd, "ltt_write_event_header(trace, channel, buffer,\n");
@@ -1386,13 +1503,14 @@ int print_event_logging_function(char *basename, facility_t *fac,
        fprintf(fd, "reserve_size, before_hdr_pad, tsc);\n");
        print_tabs(2, fd);
        fprintf(fd, "*to_base += before_hdr_pad + after_hdr_pad + header_size;\n");
+       fprintf(fd, "\n");
        
-       /* write data : assume stack alignment is the same as struct alignment. */
+       /* write data. */
 
        for(unsigned int i=0;i<event->fields.position;i++){
                field_t *field = (field_t*)(event->fields.array[i]);
                type_descriptor_t *type = field->type;
-
+       
                /* Set from */
                print_tabs(2, fd);
                switch(type->type) {
@@ -1401,23 +1519,23 @@ int print_event_logging_function(char *basename, facility_t *fac,
                        case ARRAY:
                        case STRUCT:
                        case STRING:
-                               fprintf(fd, "*from = %s;\n", field->name);
+                               fprintf(fd, "*from = lttng_param_%s;\n", field->name);
                                break;
                        default:
-                               fprintf(fd, "*from = &%s;\n", field->name);
+                               fprintf(fd, "*from = &lttng_param_%s;\n", field->name);
                                break;
                }
 
 
                if(print_type_write(type,
-                               fd, 2, basename, field->name, "", 0)) return 1;
+                               fd, 2, basename, field->name, "lttng_param_", 0)) return 1;
                fprintf(fd, "\n");
                
                /* Don't forget to flush pending memcpy */
                print_tabs(2, fd);
                fprintf(fd, "/* Flush pending memcpy */\n");
                print_tabs(2, fd);
-               fprintf(fd, "if(len != 0) {\n");
+               fprintf(fd, "if(*len != 0) {\n");
                print_tabs(3, fd);
                fprintf(fd, "memcpy(buffer+*to_base+*to, *from, *len);\n");
                print_tabs(3, fd);
@@ -1433,6 +1551,8 @@ int print_event_logging_function(char *basename, facility_t *fac,
 
        
        /* commit */
+       // for DEBUG only.
+       //fprintf(fd, "commit:\n"); /* DEBUG! */
        print_tabs(2, fd);
        fprintf(fd, "ltt_commit_slot(relayfs_buf, buffer, slot_size);\n\n");
        
@@ -1460,7 +1580,12 @@ void print_log_header_head(facility_t *fac, FILE *fd)
        fprintf(fd, "#ifndef _LTT_FACILITY_%s_H_\n", fac->capname);
        fprintf(fd, "#define _LTT_FACILITY_%s_H_\n\n", fac->capname);
   fprintf(fd, "#include <linux/types.h>\n");
-  fprintf(fd, "#include <linux/ltt/ltt-facility-id-%s.h>\n", fac->name);
+       if(!fac->arch)
+         fprintf(fd, "#include <linux/ltt/ltt-facility-id-%s.h>\n", fac->name);
+       else
+         fprintf(fd, "#include <asm/ltt/ltt-facility-id-%s_%s.h>\n",
+                               fac->name,
+                               fac->arch);
   fprintf(fd, "#include <linux/ltt-core.h>\n");
        fprintf(fd, "\n");
 }
@@ -1550,6 +1675,14 @@ int print_log_header(facility_t *fac)
        strncat(filename, fac->name, PATH_MAX - filename_size);
        filename_size = strlen(filename);
 
+       if(fac->arch) {
+               strncat(filename, "_", PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+
+               strncat(filename, fac->arch, PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+       }
+
        strncat(filename, ".h", PATH_MAX - filename_size);
        filename_size = strlen(filename);
        
@@ -1598,6 +1731,14 @@ int print_id_header(facility_t *fac)
        strncat(filename, fac->name, PATH_MAX - filename_size);
        filename_size = strlen(filename);
 
+       if(fac->arch) {
+               strncat(filename, "_", PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+
+               strncat(filename, fac->arch, PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+       }
+
        strncat(filename, ".h", PATH_MAX - filename_size);
        filename_size = strlen(filename);
        
@@ -1665,6 +1806,14 @@ int print_loader_header(facility_t *fac)
        strncat(filename, fac->name, PATH_MAX - filename_size);
        filename_size = strlen(filename);
 
+       if(fac->arch) {
+               strncat(filename, "_", PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+
+               strncat(filename, fac->arch, PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+       }
+
        strncat(filename, ".h", PATH_MAX - filename_size);
        filename_size = strlen(filename);
        
@@ -1680,8 +1829,13 @@ int print_loader_header(facility_t *fac)
   fprintf(fd, "#define _LTT_FACILITY_LOADER_%s_H_\n\n", fac->capname);
   fprintf(fd, "#ifdef CONFIG_LTT\n\n");
   fprintf(fd,"#include <linux/ltt-facilities.h>\n");
-  fprintf(fd,"#include <linux/ltt/ltt-facility-id-%s.h>\n\n",
-                       fac->name);
+       if(!fac->arch)
+         fprintf(fd,"#include <linux/ltt/ltt-facility-id-%s.h>\n\n",
+                               fac->name);
+       else
+         fprintf(fd,"#include <asm/ltt/ltt-facility-id-%s_%s.h>\n\n",
+                               fac->name,
+                               fac->arch);
   fprintf(fd,"ltt_facility_t\tltt_facility_%s;\n", fac->name);
   fprintf(fd,"ltt_facility_t\tltt_facility_%s_%X;\n\n",
                        fac->name, fac->checksum);
@@ -1717,6 +1871,14 @@ int print_loader_c(facility_t *fac)
        strncat(filename, fac->name, PATH_MAX - filename_size);
        filename_size = strlen(filename);
 
+       if(fac->arch) {
+               strncat(filename, "_", PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+
+               strncat(filename, fac->arch, PATH_MAX - filename_size);
+               filename_size = strlen(filename);
+       }
+
        strncat(filename, ".c", PATH_MAX - filename_size);
        filename_size = strlen(filename);
        
@@ -1729,7 +1891,10 @@ int print_loader_c(facility_t *fac)
        }
 
   fprintf(fd, "/*\n");
-  fprintf(fd, " * ltt-facility-loader-%s.c\n", fac->name);
+       if(!fac->arch)
+         fprintf(fd, " * ltt-facility-loader-%s.c\n", fac->name);
+       else
+         fprintf(fd, " * ltt-facility-loader-%s_%s.c\n", fac->name, fac->arch);
   fprintf(fd, " *\n");
   fprintf(fd, " * (C) Copyright  2005 - \n");
   fprintf(fd, " *          Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca)\n");
@@ -1743,7 +1908,11 @@ int print_loader_c(facility_t *fac)
   fprintf(fd, "#include <linux/module.h>\n");
   fprintf(fd, "#include <linux/init.h>\n");
   fprintf(fd, "#include <linux/config.h>\n");
-  fprintf(fd, "#include \"ltt-facility-loader-%s.h\"\n", fac->name);
+       if(!fac->arch)
+       fprintf(fd, "#include \"ltt-facility-loader-%s.h\"\n", fac->name);
+       else
+         fprintf(fd, "#include \"ltt-facility-loader-%s_%s.h\"\n",
+                               fac->name, fac->arch);
   fprintf(fd, "\n");
   fprintf(fd, "\n");
   fprintf(fd, "#ifdef CONFIG_LTT\n");
This page took 0.065083 seconds and 4 git commands to generate.