login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
December
»
9
Re: [PATCH 13/15] small_traces: Add config option to shrink trace events.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Frederic Weisbecker
Subject:
Re: [PATCH 13/15] small_traces: Add config option to shrink trace events.
Date: Thursday, December 9, 2010 - 8:28 am
On Thu, Dec 09, 2010 at 10:08:17AM -0500, Steven Rostedt wrote:
quoted text
> On Thu, 2010-12-09 at 15:55 +0100, Frederic Weisbecker wrote: > > On Fri, Dec 03, 2010 at 09:54:12PM -0500, Steven Rostedt wrote: > > > On Fri, 2010-12-03 at 18:33 -0800, David Sharp wrote: > > > > I considered that, and I generally thing it's a good idea. However, I > > > > also want to use this switch to shrink individual tracepoint event > > > > structures. > > > > > > > > eg: sched switch is a high frequency event and it is 68 bytes (60 > > > > after these patches) > > > > > > > > Can you suggest a syntax for TRACE_EVENT, DECLARE_EVENT_CLASS, etc, > > > > that could express the two versions and produce the right code? > > > > > > > > I'm worried about adding even further complexity to the TRACE_EVENT > > > > macros. I could add TRACE_EVENT_SMALL that takes two versions of > > > > TP_STRUCT__entry, TP_fast_assign, and TP_printk each, but then this > > > > will need to be permuted with your TP_CONDITIONAL patches as well. > > > > > > I would not touch the TRACE_EVENT() structures. They are there as is and > > > I would not think about changing them. Something like that would never > > > make it into mainline. > > > > > > Now what you can do, is to make your own events based off of the same > > > tracepoints. For example, the TRACE_EVENT(sched_switch...) has in > > > sched.c: > > > > > > trace_sched_switch(prev, next); > > > > > > > > > You could even write a module that does something like this: > > > > > > register_trace_sched_switch(probe_sched_switch, mydata); > > > > > > > > > > > > void probe_sched_switch(void *mydata, > > > struct task_struct *prev, > > > struct task_struct *next) > > > { > > > struct ring_buffer *buffer; > > > struct ring_buffer_event *event; > > > struct myentry *entry; > > > > > > event = trace_current_buffer_lock_reserve(buffer, > > > mytype, sizeof(*entry), > > > 0, 0); > > > > > > if (!event) > > > return; > > > > > > entry = ring_buffer_event_data(event); > > > > > > entry->myfield = prev->x; > > > ... > > > > > > trace_nowake_buffer_unlock_commit(buffer, event, > > > 0, 0); > > > } > > > > > > You will need to do a register_ftrace_event() to register that 'mytype' > > > and how to output it. Otherwise it would just be ignored in the "trace" > > > file. > > > > > > All of the above would work fine as a loadable module that you could > > > easily maintain out of tree, and still uses the internals of the system. > > > > > > -- Steve > > > > > > > > > > > > But this would improve only google's tracing while this is a general > > mainline tracing problem. > > > > The first thing is that we need to get rid of the lock_depth field, the bkl > > is dying. > > Yeah that needs to go :-) > > > > > For the rest what about having a bitmap of the fields we want to ignore, > > which can be setup from a trace file for ftrace and as an ioctl for perf. > > > > So this bitmap is easy to implement on the common fields. > > > > For the rest, one could choose between using TP_fast_assign() > > and TP_cond_assign(). > > > > TP_fast_assign() stays as is and doesn't implement bitmap field > > ignoring. Those who want conditional record will need > > TP_cond_assign(). > > Well, unfortunately this probably requires us to play > > the same trickery than SYSCALL_DEFINE() in that we'll probably > > need TP_cond_assign1(), TP_cond_assign2(), TP_cond_assign3(), etc... > > > > #define TP_cond_assignx(nr, assign) \ > > if (call->bitmask & nr) { \ > > assign > > } > > > > #define TP_cond_assign2(nr, assign, ...) \ > > TP_cond_assignx(nr, assign) \ > > TP_cond_assign1(nr + 1, __VA_ARGS__) > > > > #define TP_cond_assign3(nr, assign, ...) \ > > TP_cond_assignx(nr, assign) \ > > TP_cond_assign2(nr + 1, __VA_ARGS__) > > > > That will also require a bit more trickery to dynamically > > pre-compute the size of the trace entry. > > Mathieu is working on encapsulating the assignments in their own macros. > > Instead of doing: > > __entry->foo = bar; > > We will have: > > tp_assign(foo, bar); > > This way we could probably use this to dynamically figure out what to > assign. > > -- Steve > >
Yep, it should also work that way. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[Patch 00/15] Reduce tracing payload size.
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 01/15] tracing: Add a 'buffer_overwrite' debugfs file
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 02/15] ring_buffer.c: Remove unused #include <linux ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 03/15] ring_buffer: Align buffer_page struct alloca ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 04/15] ftrace: pack event structures.
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 05/15] ftrace: fix event alignment: ftrace:context_ ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 06/15] ftrace: fix event alignment: module:module_r ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_hype ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 08/15] ftrace: fix event alignment: mce:mce_record
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 09/15] ftrace: fix event alignment: skb:kfree_skb
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 10/15] ftrace: fix event alignment: jbd2:*
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 11/15] ftrace: fix event alignment: ext4:*
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 12/15] trace_output.c: adjust conditional expressio ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 13/15] small_traces: Add config option to shrink tr ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 14/15] small_traces: Remove trace output of large f ...
, David Sharp
, (Fri Dec 3, 5:13 pm)
[PATCH 15/15] small_traces: Remove 8 bytes from trace_entry.
, David Sharp
, (Fri Dec 3, 5:13 pm)
Re: [PATCH 03/15] ring_buffer: Align buffer_page struct al ...
, Steven Rostedt
, (Fri Dec 3, 6:43 pm)
Re: [PATCH 06/15] ftrace: fix event alignment: module:modu ...
, Steven Rostedt
, (Fri Dec 3, 6:47 pm)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, Steven Rostedt
, (Fri Dec 3, 6:49 pm)
Re: [PATCH 08/15] ftrace: fix event alignment: mce:mce_record
, Steven Rostedt
, (Fri Dec 3, 6:50 pm)
Re: [PATCH 09/15] ftrace: fix event alignment: skb:kfree_skb
, Steven Rostedt
, (Fri Dec 3, 6:52 pm)
Re: [PATCH 10/15] ftrace: fix event alignment: jbd2:*
, Steven Rostedt
, (Fri Dec 3, 6:52 pm)
Re: [PATCH 11/15] ftrace: fix event alignment: ext4:*
, Steven Rostedt
, (Fri Dec 3, 6:53 pm)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Steven Rostedt
, (Fri Dec 3, 6:56 pm)
Re: [PATCH 01/15] tracing: Add a 'buffer_overwrite' debugf ...
, Steven Rostedt
, (Fri Dec 3, 6:57 pm)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, David Sharp
, (Fri Dec 3, 7:33 pm)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Steven Rostedt
, (Fri Dec 3, 7:54 pm)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, Avi Kivity
, (Sat Dec 4, 1:11 am)
Re: [PATCH 09/15] ftrace: fix event alignment: skb:kfree_skb
, Neil Horman
, (Sat Dec 4, 6:38 am)
Re: [PATCH 06/15] ftrace: fix event alignment: module:modu ...
, Li Zefan
, (Sun Dec 5, 6:28 pm)
Re: [Patch 00/15] Reduce tracing payload size.
, Andi Kleen
, (Mon Dec 6, 6:22 am)
Re: [Patch 00/15] Reduce tracing payload size.
, Ted Ts'o
, (Mon Dec 6, 6:56 am)
Re: [Patch 00/15] Reduce tracing payload size.
, Andi Kleen
, (Mon Dec 6, 7:58 am)
Re: [Patch 00/15] Reduce tracing payload size.
, Steven Rostedt
, (Mon Dec 6, 9:17 am)
Re: [Patch 00/15] Reduce tracing payload size.
, Miguel Ojeda
, (Mon Dec 6, 9:31 am)
Re: [Patch 00/15] Reduce tracing payload size.
, Andi Kleen
, (Mon Dec 6, 9:41 am)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, David Sharp
, (Mon Dec 6, 1:38 pm)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, Avi Kivity
, (Tue Dec 7, 2:22 am)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, David Sharp
, (Tue Dec 7, 2:16 pm)
Re: [PATCH 03/15] ring_buffer: Align buffer_page struct al ...
, David Sharp
, (Tue Dec 7, 3:44 pm)
Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_ ...
, Avi Kivity
, (Wed Dec 8, 2:18 am)
Re: [PATCH 01/15] tracing: Add a 'buffer_overwrite' debugf ...
, David Sharp
, (Wed Dec 8, 1:15 pm)
[PATCH] tracing: Add an 'overwrite' trace_option.
, David Sharp
, (Wed Dec 8, 2:46 pm)
Re: [PATCH 08/15] ftrace: fix event alignment: mce:mce_record
, Frederic Weisbecker
, (Thu Dec 9, 6:33 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Frederic Weisbecker
, (Thu Dec 9, 7:55 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Steven Rostedt
, (Thu Dec 9, 8:08 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Frederic Weisbecker
, (Thu Dec 9, 8:28 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ...
, Mathieu Desnoyers
, (Thu Dec 9, 9:16 am)
Re: [PATCH] tracing: Add an 'overwrite' trace_option.
, David Sharp
, (Mon Dec 13, 5:39 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mel Gorman
Re: [PATCH 1/4] vmstat: remove zone->lock from walk_zones_in_node
Guenter Roeck
Re: [lm-sensors] Location for thermal drivers
David Woodhouse
Re: RFC: Moving firmware blobs out of the kernel.
Siddha, Suresh B
Re: [PATCH 2.6.21 review I] [11/25] x86: default to physical mode on hotplug CPU k...
Peter Zijlstra
Re: [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear)
git-commits-head
:
Linux Kernel Mailing List
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Linux Kernel Mailing List
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Linux Kernel Mailing List
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Linux Kernel Mailing List
[Bluetooth] Initiate authentication during connection establishment
Linux Kernel Mailing List
[POWERPC] 4xx: Add ppc40x_defconfig
linux-netdev
:
MERCEDES
Your mail id has won 950,000.00 in the MERCEDES Benz Online Promo.for claims send:
David Miller
Re: [PATCH] xen/netfront: do not mark packets of length < MSS as GSO
David Miller
Re: skb_segment() questions
Shan Wei
[RFC PATCH net-next 2/5]IPv6:netfilter: Send an ICMPv6 "Fragment Reassembly Timeou...
Stanislaw Gruszka
[PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations
git
:
Nicolas Sebrecht
git-svn died of signal 11 (was "3 failures on test t9100 (svn)")
Junio C Hamano
Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Martin Langhoff
Re: [PATCH] GIT commit statistics.
Alexandre Julliard
[PATCH] gitweb: Put back shortlog instead of graphiclog in the project list.
Josh Triplett
[PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
openbsd-misc
:
Taisto Qvist XX
Re: AMD GEODE LX-800 just works with kernel from install42.iso and kernelpanics wi...
Nico Meijer
Re: gOS Develop Kit with VIA pc-1 Processor Platform VIA C7-D
Andreas Bihlmaier
Re: jetway board sensors (Fintek F71805F)
admin
Drive a 2009 car from R799p/m
Antti Harri
Re: how to create a sha256 hash
Colocation donated by:
Syndicate