ANDROID: trace: fix compilation for 4.1
Change-Id: Id88b5d30847bc6d3cfe1d8cd00cbdc975c9712d1 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
@ -1597,7 +1597,7 @@ void tracing_reset_all_online_cpus(void)
|
||||
|
||||
#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];
|
||||
@ -1886,7 +1886,7 @@ int trace_find_tgid(int pid)
|
||||
|
||||
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
|
||||
@ -4636,17 +4636,17 @@ tracing_saved_tgids_read(struct file *file, char __user *ubuf,
|
||||
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;
|
||||
|
||||
|
||||
@ -868,13 +868,15 @@ static enum print_line_t trace_graph_ent_trace(struct trace_iterator *iter, int
|
||||
|
||||
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;
|
||||
@ -887,9 +889,10 @@ static enum print_line_t trace_graph_ent_raw(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
@ -903,8 +906,8 @@ static enum print_line_t trace_graph_ent_hex(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
}
|
||||
@ -917,8 +920,8 @@ static enum print_line_t trace_graph_ent_bin(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
}
|
||||
@ -945,13 +948,15 @@ static enum print_line_t trace_graph_ret_trace(struct trace_iterator *iter, int
|
||||
|
||||
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;
|
||||
@ -964,12 +969,13 @@ static enum print_line_t trace_graph_ret_raw(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
@ -983,11 +989,11 @@ static enum print_line_t trace_graph_ret_hex(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
}
|
||||
@ -1000,11 +1006,11 @@ static enum print_line_t trace_graph_ret_bin(struct trace_iterator *iter, int fl
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user