printf("%s", s);
if (pci->ofp)
- fprintf(pci->ofp,"%s",s);
+ fprintf(pci->ofp, "%s", s);
}
static char hstring[256];
{
int ret = 0;
+ if (output_name && !pci->ofp) {
+ snprintf(pci->ofname, sizeof(pci->ofname) - 1,
+ "%s_log.%d", output_name, pci->cpu);
+
+ pci->ofp = fopen(pci->ofname, "w");
+ if (pci->ofp == NULL) {
+ perror(pci->ofname);
+ return 1;
+ }
+ }
+
if (t->action & BLK_TC_ACT(BLK_TC_PC))
ret = dump_trace_pc(t, pci);
else
pci = &per_cpu_info[bit->cpu];
- if (output_name && !pci->ofp) {
- snprintf(pci->ofname, sizeof(pci->ofname) - 1,
- "%s_log.%d", output_name, bit->cpu);
-
- pci->ofp = fopen(pci->ofname, "w");
- if (pci->ofp == NULL) {
- perror(pci->ofname);
- break;
- }
- }
-
pci->nelems++;
if (trace_rb_insert(t))