mirror of https://github.com/OpenIPC/firmware.git
212 lines
5.8 KiB
Diff
212 lines
5.8 KiB
Diff
diff -drupN a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
|
|
--- a/kernel/trace/trace_output.c 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/kernel/trace/trace_output.c 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -530,11 +530,21 @@ int trace_print_context(struct trace_ite
|
|
unsigned long long t;
|
|
unsigned long secs, usec_rem;
|
|
char comm[TASK_COMM_LEN];
|
|
+ int tgid;
|
|
|
|
trace_find_cmdline(entry->pid, comm);
|
|
|
|
- trace_seq_printf(s, "%16s-%-5d [%03d] ",
|
|
- comm, entry->pid, iter->cpu);
|
|
+ trace_seq_printf(s, "%16s-%-5d ", comm, entry->pid);
|
|
+
|
|
+ if (tr->trace_flags & TRACE_ITER_TGID) {
|
|
+ tgid = trace_find_tgid(entry->pid);
|
|
+ if (tgid < 0)
|
|
+ trace_seq_puts(s, "(-----) ");
|
|
+ else
|
|
+ trace_seq_printf(s, "(%5d) ", tgid);
|
|
+ }
|
|
+
|
|
+ trace_seq_printf(s, "[%03d] ", iter->cpu);
|
|
|
|
if (tr->trace_flags & TRACE_ITER_IRQ_INFO)
|
|
trace_print_lat_fmt(s, entry);
|
|
@@ -849,6 +859,174 @@ static struct trace_event trace_fn_event
|
|
.funcs = &trace_fn_funcs,
|
|
};
|
|
|
|
+/* TRACE_GRAPH_ENT */
|
|
+static enum print_line_t trace_graph_ent_trace(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+ struct ftrace_graph_ent_entry *field;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ 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;
|
|
+
|
|
+ trace_seq_puts(s, "\n");
|
|
+ if (trace_seq_has_overflowed(s))
|
|
+ return TRACE_TYPE_PARTIAL_LINE;
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ent_raw(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ent_entry *field;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ trace_seq_printf(&iter->seq, "%lx %d\n",
|
|
+ field->graph_ent.func,
|
|
+ field->graph_ent.depth);
|
|
+ if (trace_seq_has_overflowed(&iter->seq))
|
|
+ return TRACE_TYPE_PARTIAL_LINE;
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ent_hex(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ent_entry *field;
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ SEQ_PUT_HEX_FIELD(s, field->graph_ent.func);
|
|
+ SEQ_PUT_HEX_FIELD(s, field->graph_ent.depth);
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ent_bin(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ent_entry *field;
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ SEQ_PUT_FIELD(s, field->graph_ent.func);
|
|
+ SEQ_PUT_FIELD(s, field->graph_ent.depth);
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static struct trace_event_functions trace_graph_ent_funcs = {
|
|
+ .trace = trace_graph_ent_trace,
|
|
+ .raw = trace_graph_ent_raw,
|
|
+ .hex = trace_graph_ent_hex,
|
|
+ .binary = trace_graph_ent_bin,
|
|
+};
|
|
+
|
|
+static struct trace_event trace_graph_ent_event = {
|
|
+ .type = TRACE_GRAPH_ENT,
|
|
+ .funcs = &trace_graph_ent_funcs,
|
|
+};
|
|
+
|
|
+/* TRACE_GRAPH_RET */
|
|
+static enum print_line_t trace_graph_ret_trace(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+ struct trace_entry *entry = iter->ent;
|
|
+ struct ftrace_graph_ret_entry *field;
|
|
+
|
|
+ trace_assign_type(field, entry);
|
|
+
|
|
+ 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;
|
|
+
|
|
+ trace_seq_puts(s, "\n");
|
|
+ if (trace_seq_has_overflowed(s))
|
|
+ return TRACE_TYPE_PARTIAL_LINE;
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ret_raw(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ret_entry *field;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ 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);
|
|
+ if (trace_seq_has_overflowed(&iter->seq))
|
|
+ return TRACE_TYPE_PARTIAL_LINE;
|
|
+
|
|
+ return TRACE_TYPE_HANDLED;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ret_hex(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ret_entry *field;
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ 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;
|
|
+}
|
|
+
|
|
+static enum print_line_t trace_graph_ret_bin(struct trace_iterator *iter, int flags,
|
|
+ struct trace_event *event)
|
|
+{
|
|
+ struct ftrace_graph_ret_entry *field;
|
|
+ struct trace_seq *s = &iter->seq;
|
|
+
|
|
+ trace_assign_type(field, iter->ent);
|
|
+
|
|
+ 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;
|
|
+}
|
|
+
|
|
+static struct trace_event_functions trace_graph_ret_funcs = {
|
|
+ .trace = trace_graph_ret_trace,
|
|
+ .raw = trace_graph_ret_raw,
|
|
+ .hex = trace_graph_ret_hex,
|
|
+ .binary = trace_graph_ret_bin,
|
|
+};
|
|
+
|
|
+static struct trace_event trace_graph_ret_event = {
|
|
+ .type = TRACE_GRAPH_RET,
|
|
+ .funcs = &trace_graph_ret_funcs,
|
|
+};
|
|
+
|
|
/* TRACE_CTX an TRACE_WAKE */
|
|
static enum print_line_t trace_ctxwake_print(struct trace_iterator *iter,
|
|
char *delim)
|
|
@@ -1291,6 +1469,8 @@ static struct trace_event trace_print_ev
|
|
|
|
static struct trace_event *events[] __initdata = {
|
|
&trace_fn_event,
|
|
+ &trace_graph_ent_event,
|
|
+ &trace_graph_ret_event,
|
|
&trace_ctx_event,
|
|
&trace_wake_event,
|
|
&trace_stack_event,
|