Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ftrace-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull ftrace updates from Steven Rostedt:

- Fix regression of pid filtering of function graph tracer

When the function graph tracer allowed multiple instances of graph
tracing using subops, the filtering by pid broke.

The ftrace_ops->private that was used for pid filtering wasn't
updated on creation.

The wrong function entry callback was used when pid filtering was
enabled when the function graph tracer started, which meant that
the pid filtering wasn't happening.

- Remove no longer needed ftrace_trace_task()

With PID filtering working via ftrace_pids_enabled() and
fgraph_pid_func(), the coarse-grained ftrace_trace_task()
check in graph_entry() is obsolete.

It was only a fallback for uninitialized op->private (now fixed),
and its removal ensures consistent PID filtering with standard
function tracing.

* tag 'ftrace-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
fgraph: Remove coarse PID filtering from graph_entry()
fgraph: Check ftrace_pids_enabled on registration for early filtering
fgraph: Initialize ftrace_ops->private for function graph ops

+8 -14
+8 -2
kernel/trace/fgraph.c
··· 1016 1016 mutex_init(&dst_ops->local_hash.regex_lock); 1017 1017 INIT_LIST_HEAD(&dst_ops->subop_list); 1018 1018 dst_ops->flags |= FTRACE_OPS_FL_INITIALIZED; 1019 + dst_ops->private = src_ops->private; 1019 1020 } 1020 1021 #endif 1021 1022 } ··· 1369 1368 1370 1369 ftrace_graph_active++; 1371 1370 1371 + /* Always save the function, and reset at unregistering */ 1372 + gops->saved_func = gops->entryfunc; 1373 + #ifdef CONFIG_DYNAMIC_FTRACE 1374 + if (ftrace_pids_enabled(&gops->ops)) 1375 + gops->entryfunc = fgraph_pid_func; 1376 + #endif 1377 + 1372 1378 if (ftrace_graph_active == 2) 1373 1379 ftrace_graph_disable_direct(true); 1374 1380 ··· 1395 1387 } else { 1396 1388 init_task_vars(gops->idx); 1397 1389 } 1398 - /* Always save the function, and reset at unregistering */ 1399 - gops->saved_func = gops->entryfunc; 1400 1390 1401 1391 gops->ops.flags |= FTRACE_OPS_FL_GRAPH; 1402 1392
-9
kernel/trace/trace.h
··· 1162 1162 char *params, int enable); 1163 1163 }; 1164 1164 extern bool ftrace_filter_param __initdata; 1165 - static inline int ftrace_trace_task(struct trace_array *tr) 1166 - { 1167 - return this_cpu_read(tr->array_buffer.data->ftrace_ignore_pid) != 1168 - FTRACE_PID_IGNORE; 1169 - } 1170 1165 extern int ftrace_is_dead(void); 1171 1166 int ftrace_create_function_files(struct trace_array *tr, 1172 1167 struct dentry *parent); ··· 1179 1184 int init_function_trace(void); 1180 1185 void ftrace_pid_follow_fork(struct trace_array *tr, bool enable); 1181 1186 #else 1182 - static inline int ftrace_trace_task(struct trace_array *tr) 1183 - { 1184 - return 1; 1185 - } 1186 1187 static inline int ftrace_is_dead(void) { return 0; } 1187 1188 static inline int 1188 1189 ftrace_create_function_files(struct trace_array *tr,
-3
kernel/trace/trace_functions_graph.c
··· 251 251 return 1; 252 252 } 253 253 254 - if (!ftrace_trace_task(tr)) 255 - return 0; 256 - 257 254 if (ftrace_graph_ignore_func(gops, trace)) 258 255 return 0; 259 256