Skip to content

Commit

Permalink
Merge tag 'trace-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  ...
  • Loading branch information
Linus Torvalds committed Mar 24, 2016

Unverified

No user is associated with the committer email.
2 parents faea72d + 7e6867b commit e46b4e2
Showing 17 changed files with 280 additions and 235 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/ftrace.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Code for replacing ftrace calls with jumps.
* Dynamic function tracing support.
*
* Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
*
6 changes: 3 additions & 3 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
@@ -618,7 +618,7 @@ do { \

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

#define trace_puts(str) ({ \
static const char *trace_printk_fmt \
static const char *trace_printk_fmt __used \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(str) ? str : NULL; \
\
@@ -684,7 +684,7 @@ extern void trace_dump_stack(int skip);
#define ftrace_vprintk(fmt, vargs) \
do { \
if (__builtin_constant_p(fmt)) { \
static const char *trace_printk_fmt \
static const char *trace_printk_fmt __used \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(fmt) ? fmt : NULL; \
\
7 changes: 4 additions & 3 deletions include/linux/trace_events.h
Original file line number Diff line number Diff line change
@@ -420,7 +420,8 @@ extern int call_filter_check_discard(struct trace_event_call *call, void *rec,
extern enum event_trigger_type event_triggers_call(struct trace_event_file *file,
void *rec);
extern void event_triggers_post_call(struct trace_event_file *file,
enum event_trigger_type tt);
enum event_trigger_type tt,
void *rec);

bool trace_event_ignore_this_pid(struct trace_event_file *trace_file);

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

if (tt)
event_triggers_post_call(file, tt);
event_triggers_post_call(file, tt, entry);
}

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

if (tt)
event_triggers_post_call(file, tt);
event_triggers_post_call(file, tt, entry);
}

#ifdef CONFIG_BPF_EVENTS
42 changes: 4 additions & 38 deletions include/trace/events/kmem.h
Original file line number Diff line number Diff line change
@@ -140,42 +140,19 @@ DEFINE_EVENT(kmem_free, kfree,
TP_ARGS(call_site, ptr)
);

DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,
DEFINE_EVENT(kmem_free, kmem_cache_free,

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

TP_ARGS(call_site, ptr),

/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id()))
TP_ARGS(call_site, ptr)
);

TRACE_EVENT_CONDITION(mm_page_free,
TRACE_EVENT(mm_page_free,

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

TP_ARGS(page, order),


/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id())),

TP_STRUCT__entry(
__field( unsigned long, pfn )
__field( unsigned int, order )
@@ -276,23 +253,12 @@ DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
TP_ARGS(page, order, migratetype)
);

TRACE_EVENT_CONDITION(mm_page_pcpu_drain,
TRACE_EVENT(mm_page_pcpu_drain,

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

TP_ARGS(page, order, migratetype),

/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id())),

TP_STRUCT__entry(
__field( unsigned long, pfn )
__field( unsigned int, order )
4 changes: 1 addition & 3 deletions include/trace/events/tlb.h
Original file line number Diff line number Diff line change
@@ -34,13 +34,11 @@ TLB_FLUSH_REASON
#define EM(a,b) { a, b },
#define EMe(a,b) { a, b }

TRACE_EVENT_CONDITION(tlb_flush,
TRACE_EVENT(tlb_flush,

TP_PROTO(int reason, unsigned long pages),
TP_ARGS(reason, pages),

TP_CONDITION(cpu_online(smp_processor_id())),

TP_STRUCT__entry(
__field( int, reason)
__field(unsigned long, pages)
Loading

0 comments on commit e46b4e2

Please sign in to comment.