#define SAVED_CMDLINES_DEFAULT 128
#define NO_CMDLINE_MAP UINT_MAX
-static unsigned saved_tgids[SAVED_CMDLINES];
+static unsigned saved_tgids[SAVED_CMDLINES_DEFAULT];
static arch_spinlock_t trace_cmdline_lock = __ARCH_SPIN_LOCK_UNLOCKED;
struct saved_cmdlines_buffer {
unsigned map_pid_to_cmdline[PID_MAX_DEFAULT+1];
preempt_disable();
arch_spin_lock(&trace_cmdline_lock);
- map = map_pid_to_cmdline[pid];
+ map = savedcmd->map_pid_to_cmdline[pid];
if (map != NO_CMDLINE_MAP)
tgid = saved_tgids[map];
else
int pid;
int i;
- file_buf = kmalloc(SAVED_CMDLINES*(16+1+16), GFP_KERNEL);
+ file_buf = kmalloc(SAVED_CMDLINES_DEFAULT*(16+1+16), GFP_KERNEL);
if (!file_buf)
return -ENOMEM;
buf = file_buf;
- for (i = 0; i < SAVED_CMDLINES; i++) {
+ for (i = 0; i < SAVED_CMDLINES_DEFAULT; i++) {
int tgid;
int r;
- pid = map_cmdline_to_pid[i];
+ pid = savedcmd->map_cmdline_to_pid[i];
if (pid == -1 || pid == NO_CMDLINE_MAP)
continue;
trace_assign_type(field, iter->ent);
- if (!trace_seq_puts(s, "graph_ent: func="))
+ trace_seq_puts(s, "graph_ent: func=");
+ if (trace_seq_has_overflowed(s))
return TRACE_TYPE_PARTIAL_LINE;
if (!seq_print_ip_sym(s, field->graph_ent.func, flags))
return TRACE_TYPE_PARTIAL_LINE;
- if (!trace_seq_puts(s, "\n"))
+ trace_seq_puts(s, "\n");
+ if (trace_seq_has_overflowed(s))
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED;
trace_assign_type(field, iter->ent);
- if (!trace_seq_printf(&iter->seq, "%lx %d\n",
+ trace_seq_printf(&iter->seq, "%lx %d\n",
field->graph_ent.func,
- field->graph_ent.depth))
+ field->graph_ent.depth);
+ if (trace_seq_has_overflowed(&iter->seq))
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED;
trace_assign_type(field, iter->ent);
- SEQ_PUT_HEX_FIELD_RET(s, field->graph_ent.func);
- SEQ_PUT_HEX_FIELD_RET(s, field->graph_ent.depth);
+ SEQ_PUT_HEX_FIELD(s, field->graph_ent.func);
+ SEQ_PUT_HEX_FIELD(s, field->graph_ent.depth);
return TRACE_TYPE_HANDLED;
}
trace_assign_type(field, iter->ent);
- SEQ_PUT_FIELD_RET(s, field->graph_ent.func);
- SEQ_PUT_FIELD_RET(s, field->graph_ent.depth);
+ SEQ_PUT_FIELD(s, field->graph_ent.func);
+ SEQ_PUT_FIELD(s, field->graph_ent.depth);
return TRACE_TYPE_HANDLED;
}
trace_assign_type(field, entry);
- if (!trace_seq_puts(s, "graph_ret: func="))
+ trace_seq_puts(s, "graph_ret: func=");
+ if (trace_seq_has_overflowed(s))
return TRACE_TYPE_PARTIAL_LINE;
if (!seq_print_ip_sym(s, field->ret.func, flags))
return TRACE_TYPE_PARTIAL_LINE;
- if (!trace_seq_puts(s, "\n"))
+ trace_seq_puts(s, "\n");
+ if (trace_seq_has_overflowed(s))
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED;
trace_assign_type(field, iter->ent);
- if (!trace_seq_printf(&iter->seq, "%lx %lld %lld %ld %d\n",
+ trace_seq_printf(&iter->seq, "%lx %lld %lld %ld %d\n",
field->ret.func,
field->ret.calltime,
field->ret.rettime,
field->ret.overrun,
- field->ret.depth));
+ field->ret.depth);
+ if (trace_seq_has_overflowed(&iter->seq))
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED;
trace_assign_type(field, iter->ent);
- SEQ_PUT_HEX_FIELD_RET(s, field->ret.func);
- SEQ_PUT_HEX_FIELD_RET(s, field->ret.calltime);
- SEQ_PUT_HEX_FIELD_RET(s, field->ret.rettime);
- SEQ_PUT_HEX_FIELD_RET(s, field->ret.overrun);
- SEQ_PUT_HEX_FIELD_RET(s, field->ret.depth);
+ SEQ_PUT_HEX_FIELD(s, field->ret.func);
+ SEQ_PUT_HEX_FIELD(s, field->ret.calltime);
+ SEQ_PUT_HEX_FIELD(s, field->ret.rettime);
+ SEQ_PUT_HEX_FIELD(s, field->ret.overrun);
+ SEQ_PUT_HEX_FIELD(s, field->ret.depth);
return TRACE_TYPE_HANDLED;
}
trace_assign_type(field, iter->ent);
- SEQ_PUT_FIELD_RET(s, field->ret.func);
- SEQ_PUT_FIELD_RET(s, field->ret.calltime);
- SEQ_PUT_FIELD_RET(s, field->ret.rettime);
- SEQ_PUT_FIELD_RET(s, field->ret.overrun);
- SEQ_PUT_FIELD_RET(s, field->ret.depth);
+ SEQ_PUT_FIELD(s, field->ret.func);
+ SEQ_PUT_FIELD(s, field->ret.calltime);
+ SEQ_PUT_FIELD(s, field->ret.rettime);
+ SEQ_PUT_FIELD(s, field->ret.overrun);
+ SEQ_PUT_FIELD(s, field->ret.depth);
return TRACE_TYPE_HANDLED;
}