- fprintf(fp, "\t\t\tevent_length = (unsigned long)ptr -"
- "(unsigned long)(buf->data + old_offset);\n");
-
- /* let's put some protection before the cmpxchg : the space reservation and
- * the get TSC are not dependant from each other. I don't want the compiler
- * to reorder those in the wrong order. And relay_reserve is inline, so
- * _yes_, the compiler could mess it up. */
- fprintf(fp, "\t\t\tbarrier();\n");
- fprintf(fp, "\t\t\tbuff = relay_reserve(channel->rchan, event_length, "
- "old_offset);\n");
- fprintf(fp, "\n");
- fprintf(fp, "\t\t} while(PTR_ERR(buff) == -EAGAIN);\n");
- fprintf(fp, "\n");
-
-
- /* Reserve the channel */
- //fprintf(fp, "\t\tbuff = relay_reserve(channel->rchan, event_length);\n");
- fprintf(fp, "\t\tif(buff == NULL) {\n");
- fprintf(fp, "\t\t\t/* Buffer is full*/\n");
- fprintf(fp, "\t\t\t/* for debug BUG(); */\n"); // DEBUG!
- fprintf(fp, "\t\t\tchannel->events_lost[smp_processor_id()]++;\n");
- fprintf(fp, "\t\t\tbreak;\n"); /* don't commit a NULL reservation! */
- fprintf(fp, "\t\t}\n");
-
- /* DEBUG */
- //fprintf(fp, "\t\tif(resret == 1) {\n");
- //fprintf(fp, "printk(\"f%%lu e\%%u \", ltt_facility_%s_%X, event_%s);",
- // facName, checksum, ev->name);
- //fprintf(fp, "\t\t}\n");
-
- /* Write the header */
- fprintf(fp, "\n");
- fprintf(fp,"\t\tlength = event_length - _offset - header_length;\n");
- fprintf(fp, "\n");
- fprintf(fp, "\t\tltt_write_event_header(trace, channel, buff, \n"
- "\t\t\t\tltt_facility_%s_%X, event_%s, length, _offset,\n"
- "\t\t\t\t&delta, &tsc);\n",
- facName, checksum, ev->name);
- fprintf(fp, "\n");