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.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull fgraph updates from Steven Rostedt:
"Remove calltime and rettime from fgraph infrastructure

The calltime and rettime were used by the function graph tracer to
calculate the timings of functions where it traced their entry and
exit. The calltime and rettime were stored in the generic structures
that were used for the mechanisms to add an entry and exit callback.

Now that function graph infrastructure is used by other subsystems
than just the tracer, the calltime and rettime are not needed for
them. Remove the calltime and rettime from the generic fgraph
infrastructure and have the callers that require them handle them"

* tag 'ftrace-v6.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
fgraph: Remove calltime and rettime from generic operations

+33 -26
-2
include/linux/ftrace.h
··· 1151 1151 int depth; 1152 1152 /* Number of functions that overran the depth limit for current task */ 1153 1153 unsigned int overrun; 1154 - unsigned long long calltime; 1155 - unsigned long long rettime; 1156 1154 } __packed; 1157 1155 1158 1156 struct fgraph_ops;
-1
kernel/trace/fgraph.c
··· 826 826 return (unsigned long)panic; 827 827 } 828 828 829 - trace.rettime = trace_clock_local(); 830 829 if (fregs) 831 830 ftrace_regs_set_instruction_pointer(fregs, ret); 832 831
+3 -1
kernel/trace/trace.h
··· 924 924 unsigned long retaddr); 925 925 extern void __trace_graph_return(struct trace_array *tr, 926 926 struct ftrace_graph_ret *trace, 927 - unsigned int trace_ctx); 927 + unsigned int trace_ctx, 928 + u64 calltime, u64 rettime); 929 + 928 930 extern void init_array_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops); 929 931 extern int allocate_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops); 930 932 extern void free_fgraph_ops(struct trace_array *tr);
+4 -4
kernel/trace/trace_entries.h
··· 124 124 __field_packed( unsigned long, ret, retval ) 125 125 __field_packed( int, ret, depth ) 126 126 __field_packed( unsigned int, ret, overrun ) 127 - __field_packed( unsigned long long, ret, calltime) 128 - __field_packed( unsigned long long, ret, rettime ) 127 + __field(unsigned long long, calltime ) 128 + __field(unsigned long long, rettime ) 129 129 ), 130 130 131 131 F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d retval: %lx", ··· 146 146 __field_packed( unsigned long, ret, func ) 147 147 __field_packed( int, ret, depth ) 148 148 __field_packed( unsigned int, ret, overrun ) 149 - __field_packed( unsigned long long, ret, calltime) 150 - __field_packed( unsigned long long, ret, rettime ) 149 + __field(unsigned long long, calltime ) 150 + __field(unsigned long long, rettime ) 151 151 ), 152 152 153 153 F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d",
+19 -14
kernel/trace/trace_functions_graph.c
··· 266 266 struct ftrace_graph_ret ret = { 267 267 .func = ip, 268 268 .depth = 0, 269 - .calltime = time, 270 - .rettime = time, 271 269 }; 272 270 273 271 __trace_graph_entry(tr, &ent, trace_ctx); 274 - __trace_graph_return(tr, &ret, trace_ctx); 272 + __trace_graph_return(tr, &ret, trace_ctx, time, time); 275 273 } 276 274 277 275 void ··· 281 283 } 282 284 283 285 void __trace_graph_return(struct trace_array *tr, 284 - struct ftrace_graph_ret *trace, 285 - unsigned int trace_ctx) 286 + struct ftrace_graph_ret *trace, 287 + unsigned int trace_ctx, 288 + u64 calltime, u64 rettime) 286 289 { 287 290 struct ring_buffer_event *event; 288 291 struct trace_buffer *buffer = tr->array_buffer.buffer; ··· 295 296 return; 296 297 entry = ring_buffer_event_data(event); 297 298 entry->ret = *trace; 299 + entry->calltime = calltime; 300 + entry->rettime = rettime; 298 301 trace_buffer_unlock_commit_nostack(buffer, event); 299 302 } 300 303 ··· 318 317 struct trace_array_cpu *data; 319 318 struct fgraph_times *ftimes; 320 319 unsigned int trace_ctx; 320 + u64 calltime, rettime; 321 321 long disabled; 322 322 int size; 323 323 int cpu; 324 + 325 + rettime = trace_clock_local(); 324 326 325 327 ftrace_graph_addr_finish(gops, trace); 326 328 ··· 338 334 339 335 handle_nosleeptime(trace, ftimes, size); 340 336 341 - trace->calltime = ftimes->calltime; 337 + calltime = ftimes->calltime; 342 338 343 339 preempt_disable_notrace(); 344 340 cpu = raw_smp_processor_id(); ··· 346 342 disabled = atomic_read(&data->disabled); 347 343 if (likely(!disabled)) { 348 344 trace_ctx = tracing_gen_ctx(); 349 - __trace_graph_return(tr, trace, trace_ctx); 345 + __trace_graph_return(tr, trace, trace_ctx, calltime, rettime); 350 346 } 351 347 preempt_enable_notrace(); 352 348 } ··· 371 367 372 368 handle_nosleeptime(trace, ftimes, size); 373 369 374 - trace->calltime = ftimes->calltime; 375 - 376 370 if (tracing_thresh && 377 - (trace->rettime - ftimes->calltime < tracing_thresh)) 371 + (trace_clock_local() - ftimes->calltime < tracing_thresh)) 378 372 return; 379 373 else 380 374 trace_graph_return(trace, gops, fregs); ··· 858 856 859 857 graph_ret = &ret_entry->ret; 860 858 call = &entry->graph_ent; 861 - duration = graph_ret->rettime - graph_ret->calltime; 859 + duration = ret_entry->rettime - ret_entry->calltime; 862 860 863 861 func = call->func + iter->tr->text_delta; 864 862 ··· 1139 1137 } 1140 1138 1141 1139 static enum print_line_t 1142 - print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s, 1140 + print_graph_return(struct ftrace_graph_ret_entry *retentry, struct trace_seq *s, 1143 1141 struct trace_entry *ent, struct trace_iterator *iter, 1144 1142 u32 flags) 1145 1143 { 1146 - unsigned long long duration = trace->rettime - trace->calltime; 1144 + struct ftrace_graph_ret *trace = &retentry->ret; 1145 + u64 calltime = retentry->calltime; 1146 + u64 rettime = retentry->rettime; 1147 + unsigned long long duration = rettime - calltime; 1147 1148 struct fgraph_data *data = iter->private; 1148 1149 struct trace_array *tr = iter->tr; 1149 1150 unsigned long func; ··· 1347 1342 case TRACE_GRAPH_RET: { 1348 1343 struct ftrace_graph_ret_entry *field; 1349 1344 trace_assign_type(field, entry); 1350 - return print_graph_return(&field->ret, s, entry, iter, flags); 1345 + return print_graph_return(field, s, entry, iter, flags); 1351 1346 } 1352 1347 case TRACE_STACK: 1353 1348 case TRACE_FN:
+3 -2
kernel/trace/trace_irqsoff.c
··· 223 223 unsigned long flags; 224 224 unsigned int trace_ctx; 225 225 u64 *calltime; 226 + u64 rettime; 226 227 int size; 227 228 228 229 ftrace_graph_addr_finish(gops, trace); ··· 231 230 if (!func_prolog_dec(tr, &data, &flags)) 232 231 return; 233 232 233 + rettime = trace_clock_local(); 234 234 calltime = fgraph_retrieve_data(gops->idx, &size); 235 235 if (!calltime) 236 236 return; 237 - trace->calltime = *calltime; 238 237 239 238 trace_ctx = tracing_gen_ctx_flags(flags); 240 - __trace_graph_return(tr, trace, trace_ctx); 239 + __trace_graph_return(tr, trace, trace_ctx, *calltime, rettime); 241 240 atomic_dec(&data->disabled); 242 241 } 243 242
+4 -2
kernel/trace/trace_sched_wakeup.c
··· 158 158 struct trace_array_cpu *data; 159 159 unsigned int trace_ctx; 160 160 u64 *calltime; 161 + u64 rettime; 161 162 int size; 162 163 163 164 ftrace_graph_addr_finish(gops, trace); ··· 166 165 if (!func_prolog_preempt_disable(tr, &data, &trace_ctx)) 167 166 return; 168 167 168 + rettime = trace_clock_local(); 169 + 169 170 calltime = fgraph_retrieve_data(gops->idx, &size); 170 171 if (!calltime) 171 172 return; 172 - trace->calltime = *calltime; 173 173 174 - __trace_graph_return(tr, trace, trace_ctx); 174 + __trace_graph_return(tr, trace, trace_ctx, *calltime, rettime); 175 175 atomic_dec(&data->disabled); 176 176 177 177 preempt_enable_notrace();