Skip to content

Commit e46b4e2

Browse files
committed
Merge tag 'trace-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: "Nothing major this round. Mostly small clean ups and fixes. Some visible changes: - A new flag was added to distinguish traces done in NMI context. - Preempt tracer now shows functions where preemption is disabled but interrupts are still enabled. Other notes: - Updates were done to function tracing to allow better performance with perf. - Infrastructure code has been added to allow for a new histogram feature for recording live trace event histograms that can be configured by simple user commands. The feature itself was just finished, but needs a round in linux-next before being pulled. This only includes some infrastructure changes that will be needed" * tag 'trace-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (22 commits) tracing: Record and show NMI state tracing: Fix trace_printk() to print when not using bprintk() tracing: Remove redundant reset per-CPU buff in irqsoff tracer x86: ftrace: Fix the misleading comment for arch/x86/kernel/ftrace.c tracing: Fix crash from reading trace_pipe with sendfile tracing: Have preempt(irqs)off trace preempt disabled functions tracing: Fix return while holding a lock in register_tracer() ftrace: Use kasprintf() in ftrace_profile_tracefs() ftrace: Update dynamic ftrace calls only if necessary ftrace: Make ftrace_hash_rec_enable return update bool tracing: Fix typoes in code comment and printk in trace_nop.c tracing, writeback: Replace cgroup path to cgroup ino tracing: Use flags instead of bool in trigger structure tracing: Add an unreg_all() callback to trigger commands tracing: Add needs_rec flag to event triggers tracing: Add a per-event-trigger 'paused' field tracing: Add get_syscall_name() tracing: Add event record param to trigger_ops.func() tracing: Make event trigger functions available tracing: Make ftrace_event_field checking functions available ...
2 parents faea72d + 7e6867b commit e46b4e2

17 files changed

Lines changed: 280 additions & 235 deletions

‎arch/x86/kernel/ftrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Code for replacing ftrace calls with jumps.
2+
* Dynamic function tracing support.
33
*
44
* Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
55
*

‎include/linux/kernel.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ do { \
618618

619619
#define do_trace_printk(fmt, args...) \
620620
do { \
621-
static const char *trace_printk_fmt \
621+
static const char *trace_printk_fmt __used \
622622
__attribute__((section("__trace_printk_fmt"))) = \
623623
__builtin_constant_p(fmt) ? fmt : NULL; \
624624
\
@@ -662,7 +662,7 @@ int __trace_printk(unsigned long ip, const char *fmt, ...);
662662
*/
663663

664664
#define trace_puts(str) ({ \
665-
static const char *trace_printk_fmt \
665+
static const char *trace_printk_fmt __used \
666666
__attribute__((section("__trace_printk_fmt"))) = \
667667
__builtin_constant_p(str) ? str : NULL; \
668668
\
@@ -684,7 +684,7 @@ extern void trace_dump_stack(int skip);
684684
#define ftrace_vprintk(fmt, vargs) \
685685
do { \
686686
if (__builtin_constant_p(fmt)) { \
687-
static const char *trace_printk_fmt \
687+
static const char *trace_printk_fmt __used \
688688
__attribute__((section("__trace_printk_fmt"))) = \
689689
__builtin_constant_p(fmt) ? fmt : NULL; \
690690
\

‎include/linux/trace_events.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ extern int call_filter_check_discard(struct trace_event_call *call, void *rec,
420420
extern enum event_trigger_type event_triggers_call(struct trace_event_file *file,
421421
void *rec);
422422
extern void event_triggers_post_call(struct trace_event_file *file,
423-
enum event_trigger_type tt);
423+
enum event_trigger_type tt,
424+
void *rec);
424425

425426
bool trace_event_ignore_this_pid(struct trace_event_file *trace_file);
426427

@@ -507,7 +508,7 @@ event_trigger_unlock_commit(struct trace_event_file *file,
507508
trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc);
508509

509510
if (tt)
510-
event_triggers_post_call(file, tt);
511+
event_triggers_post_call(file, tt, entry);
511512
}
512513

513514
/**
@@ -540,7 +541,7 @@ event_trigger_unlock_commit_regs(struct trace_event_file *file,
540541
irq_flags, pc, regs);
541542

542543
if (tt)
543-
event_triggers_post_call(file, tt);
544+
event_triggers_post_call(file, tt, entry);
544545
}
545546

546547
#ifdef CONFIG_BPF_EVENTS

‎include/trace/events/kmem.h‎

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -140,42 +140,19 @@ DEFINE_EVENT(kmem_free, kfree,
140140
TP_ARGS(call_site, ptr)
141141
);
142142

143-
DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,
143+
DEFINE_EVENT(kmem_free, kmem_cache_free,
144144

145145
TP_PROTO(unsigned long call_site, const void *ptr),
146146

147-
TP_ARGS(call_site, ptr),
148-
149-
/*
150-
* This trace can be potentially called from an offlined cpu.
151-
* Since trace points use RCU and RCU should not be used from
152-
* offline cpus, filter such calls out.
153-
* While this trace can be called from a preemptable section,
154-
* it has no impact on the condition since tasks can migrate
155-
* only from online cpus to other online cpus. Thus its safe
156-
* to use raw_smp_processor_id.
157-
*/
158-
TP_CONDITION(cpu_online(raw_smp_processor_id()))
147+
TP_ARGS(call_site, ptr)
159148
);
160149

161-
TRACE_EVENT_CONDITION(mm_page_free,
150+
TRACE_EVENT(mm_page_free,
162151

163152
TP_PROTO(struct page *page, unsigned int order),
164153

165154
TP_ARGS(page, order),
166155

167-
168-
/*
169-
* This trace can be potentially called from an offlined cpu.
170-
* Since trace points use RCU and RCU should not be used from
171-
* offline cpus, filter such calls out.
172-
* While this trace can be called from a preemptable section,
173-
* it has no impact on the condition since tasks can migrate
174-
* only from online cpus to other online cpus. Thus its safe
175-
* to use raw_smp_processor_id.
176-
*/
177-
TP_CONDITION(cpu_online(raw_smp_processor_id())),
178-
179156
TP_STRUCT__entry(
180157
__field( unsigned long, pfn )
181158
__field( unsigned int, order )
@@ -276,23 +253,12 @@ DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
276253
TP_ARGS(page, order, migratetype)
277254
);
278255

279-
TRACE_EVENT_CONDITION(mm_page_pcpu_drain,
256+
TRACE_EVENT(mm_page_pcpu_drain,
280257

281258
TP_PROTO(struct page *page, unsigned int order, int migratetype),
282259

283260
TP_ARGS(page, order, migratetype),
284261

285-
/*
286-
* This trace can be potentially called from an offlined cpu.
287-
* Since trace points use RCU and RCU should not be used from
288-
* offline cpus, filter such calls out.
289-
* While this trace can be called from a preemptable section,
290-
* it has no impact on the condition since tasks can migrate
291-
* only from online cpus to other online cpus. Thus its safe
292-
* to use raw_smp_processor_id.
293-
*/
294-
TP_CONDITION(cpu_online(raw_smp_processor_id())),
295-
296262
TP_STRUCT__entry(
297263
__field( unsigned long, pfn )
298264
__field( unsigned int, order )

‎include/trace/events/tlb.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ TLB_FLUSH_REASON
3434
#define EM(a,b) { a, b },
3535
#define EMe(a,b) { a, b }
3636

37-
TRACE_EVENT_CONDITION(tlb_flush,
37+
TRACE_EVENT(tlb_flush,
3838

3939
TP_PROTO(int reason, unsigned long pages),
4040
TP_ARGS(reason, pages),
4141

42-
TP_CONDITION(cpu_online(smp_processor_id())),
43-
4442
TP_STRUCT__entry(
4543
__field( int, reason)
4644
__field(unsigned long, pages)

0 commit comments

Comments
 (0)