* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (79 commits)
USB serial: update the console driver
usb-serial: straighten out serial_open
usb-serial: add missing tests and debug lines
usb-serial: rename subroutines
usb-serial: fix termios initialization logic
usb-serial: acquire references when a new tty is installed
usb-serial: change logic of serial lookups
usb-serial: put subroutines in logical order
usb-serial: change referencing of port and serial structures
tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl
tty: Char: mxser, add support for CP112UL
uartlite: support shared interrupt lines
tty: USB: serial/mct_u232, fix tty refcnt
tty: riscom8, fix tty refcnt
tty: riscom8, fix shutdown declaration
TTY: fix typos
tty: Power: fix suspend vt regression
tty: vt: use printk_once
tty: handle VT specific compat ioctls in vt driver
n_tty: move echoctl check and clean up logic
...
Merge branch 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (58 commits)
perf_counter: Fix perf_copy_attr() pointer arithmetic
perf utils: Use a define for the maximum length of a trace event
perf: Add timechart help text and add timechart to "perf help"
tracing, x86, cpuidle: Move the end point of a C state in the power tracer
perf utils: Be consistent about minimum text size in the svghelper
perf timechart: Add "perf timechart record"
perf: Add the timechart tool
perf: Add a SVG helper library file
tracing, perf: Convert the power tracer into an event tracer
perf: Add a sample_event type to the event_union
perf: Allow perf utilities to have "callback" options without arguments
perf: Store trace event name/id pairs in perf.data
perf: Add a timestamp to fork events
sched_clock: Make it NMI safe
perf_counter: Fix up swcounter throttling
x86, perf_counter, bts: Optimize BTS overflow handling
perf sched: Add --input=file option to builtin-sched.c
perf trace: Sample timestamp and cpu when using record flag
perf tools: Increase MAX_EVENT_LENGTH
perf tools: Fix memory leak in read_ftrace_printk()
...
Alan Stern [Fri, 4 Sep 2009 19:29:59 +0000 (15:29 -0400)]
USB serial: update the console driver
This patch (as1292) modifies the USB serial console driver, to make it
compatible with the recent changes to the USB serial core. The most
important change is that serial->disc_mutex now has to be unlocked
following a successful call to usb_serial_get_by_index().
Other less notable changes include:
Use the requested port number instead of port 0 always.
Prevent the serial device from being autosuspended.
Use the ASYNCB_INITIALIZED flag bit to indicate when the
port hardware has been initialized.
In spite of these changes, there's no question that the USB serial
console code is still a big hack.
Alan Stern [Tue, 1 Sep 2009 15:39:59 +0000 (11:39 -0400)]
usb-serial: straighten out serial_open
This patch (as1291) removes a bunch of code from serial_open(), things
that were rendered unnecessary by earlier patches. A missing spinlock
is added to protect port->port.count, which needs to be incremented
even if the open fails but not if the tty has gotten a hangup. The
test for whether the hardware has been initialized, based on the use
count, is replaced by a more transparent test of the
ASYNCB_INITIALIZED bit in the port flags.
Alan Stern [Tue, 1 Sep 2009 15:39:51 +0000 (11:39 -0400)]
usb-serial: add missing tests and debug lines
This patch (as1290) adds some missing tests. serial_down() isn't
supposed to do anything if the hardware hasn't been initialized, and
serial_close() isn't supposed to do anything if the tty has gotten a
hangup (because serial_hangup() takes care of shutting down the
hardware).
The patch also updates and adds a few debugging lines.
Alan Stern [Tue, 1 Sep 2009 15:39:40 +0000 (11:39 -0400)]
usb-serial: rename subroutines
This patch (as1289) renames serial_do_down() to serial_down() and
serial_do_free() to serial_release(). It also adds a missing call to
tty_shutdown() in serial_release().
Alan Stern [Tue, 1 Sep 2009 15:39:22 +0000 (11:39 -0400)]
usb-serial: fix termios initialization logic
This patch (as1288) fixes the initialization logic in
serial_install(). A new tty always needs to have a termios
initialized no matter what, not just in the case where the lower
driver will override the termios settings.
Alan Stern [Tue, 1 Sep 2009 15:39:13 +0000 (11:39 -0400)]
usb-serial: acquire references when a new tty is installed
This patch (as1287) makes serial_install() be reponsible for acquiring
references to the usb_serial structure and the driver module when a
tty is first used. This is more sensible than having serial_open() do
it, because a tty can be opened many times whereas it is installed
only once, when it is created. (Not to mention that these actions are
reversed when the tty is released, not when it is closed.) Finally,
it is at install time that the TTY core takes its own reference to the
usb_serial module, so it is only fitting that we should act the same
way in regard to the lower-level serial driver.
Alan Stern [Tue, 1 Sep 2009 15:38:59 +0000 (11:38 -0400)]
usb-serial: change logic of serial lookups
This patch (as1286) changes usb_serial_get_by_index(). Now the
routine will check whether the serial device has been disconnected; if
it has then the return value will be NULL. If the device hasn't been
disconnected then the routine will return with serial->disc_mutex
held, so that the caller can use the structure without fear of racing
against driver unloads.
This permits the scope of table_mutex in destroy_serial() to be
reduced. Instead of protecting the entire function, it suffices to
protect the part that actually uses serial_table[], i.e., the call to
return_serial(). There's no longer any danger of the refcount being
incremented after it reaches 0 (which was the reason for having the
large scope previously), because it can't reach 0 until the serial
device has been disconnected.
Also, the patch makes serial_install() check that serial is non-NULL
before attempting to use it.
Alan Stern [Tue, 1 Sep 2009 15:38:44 +0000 (11:38 -0400)]
usb-serial: put subroutines in logical order
This patch (as1285) rearranges the subroutines in usb-serial.c
concerned with tty lifetimes into a more logical order: install, open,
hangup, close, release. It also updates the formatting of the
kerneldoc comments.
Alan Stern [Tue, 1 Sep 2009 15:38:34 +0000 (11:38 -0400)]
usb-serial: change referencing of port and serial structures
This patch (as1284) changes the referencing of the usb_serial and
usb_serial_port structures in usb-serial.c. It's not feasible to make
the port structures keep a reference to the serial structure, because
the ports need to remain in existence when serial is released -- quite
a few of the drivers expect this. Consequently taking a reference
to the port when the device file is open is insufficient; such a
reference would not pin serial.
To fix this, we now take a reference to serial when the device file is
opened. The final put_device() for the ports occurs in
destroy_serial(), so that the ports will last as long as they are
needed.
The patch initializes all the port devices, including those in the
unused "fake" ports. This makes the code more uniform because they
can all be released in the same way. The error handling code in
usb_serial_probe() is much simplified by this approach; instead of
freeing everything by hand we can use a single usb_serial_put() call.
Also simplified is the port-release mechanism. Instead of being two
separate routines, port_release() and port_free() can be combined into
one.
Add support for MOXA:0x1120 pci device. It's a 2-port device and differs
in no way from the others. So this turns out to be a trivial
pci_device_id change.
Stanse found a tty refcnt leak in read_int_callback. In fact
it's handled wrong altogether. tty_port_tty_get can return NULL
and it's not checked in that manner.
Fix that by checking the tty_port_tty_get retval and put tty kref
properly.
Jiri Slaby [Tue, 11 Aug 2009 21:20:41 +0000 (23:20 +0200)]
tty: Power: fix suspend vt regression
vt_waitactive no longer accepts console parameter as console-1
since commit "vt: add an event interface". It expects console
number directly (as viewed by userspace -- counting from 1).
Fix a deadlock suspend regression by redefining adding one
to vt in vt_move_to_console.
Arnd Bergmann [Thu, 6 Aug 2009 13:09:28 +0000 (15:09 +0200)]
tty: handle VT specific compat ioctls in vt driver
The VT specific compat_ioctl handlers are the only ones
in common code that require the BKL. Moving them into
the vt driver lets us remove the BKL from the other handlers
and cleans up the code.
Joe Peterson [Wed, 9 Sep 2009 21:03:47 +0000 (15:03 -0600)]
n_tty: move echoctl check and clean up logic
Check L_ECHOCTL before insertting a character in the echo buffer
(rather than as the buffer is processed), to be more consistent with
when all other L_ flags are checked. Also cleaned up the related logic.
Note that this and the previous patch ("n_tty: honor opost flag for echoes")
were verified together by the reporters of the bug that patch addresses
(http://bugs.linuxbase.org/show_bug.cgi?id=2692), and the test now passes.
Joe Peterson [Wed, 9 Sep 2009 21:03:13 +0000 (15:03 -0600)]
n_tty: honor opost flag for echoes
Fixes the following bug:
http://bugs.linuxbase.org/show_bug.cgi?id=2692
Causes processing of echoed characters (output from the echo buffer) to
honor the O_OPOST flag, which is consistent with the old behavior.
Note that this and the next patch ("n_tty: move echoctl check and
clean up logic") were verified together by the bug reporters, and
the test now passes.
Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Linux Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:33 +0000 (13:13 -0700)]
tty: USB serial termios bits
Various drivers have hacks to mangle termios structures. This stems from
the fact there is no nice setup hook for configuring the termios settings
when the port is created
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Set proper console speed on resume if console suspend is disabled
Commit b5b82df6, from May 2007, breaks no_console_suspend on the OLPC
XO laptop. Basically what happens is that upon returning from resume,
serial8250_resume_port() will reconfigure the port for high speed
mode and all console output will be garbled, making debug of the
resume path painful. This patch modifies uart_resume_port() to
reset the port to the state it was in before we suspended.
Original patch by Marcelo Tosatti
Second patch by Deepak then reworked by Alan to fit with the tty changes
before it got submitted. Also fixed the console path to set c_i/ospeed as
some drivers require the termios fields are valid
Alan Cox [Sat, 19 Sep 2009 20:13:32 +0000 (13:13 -0700)]
serial: kill USF_CLOSING_* definitions
The serial layer for some reason uses different defines for the special
case close delays and then conditionally switches to/from the normal ones
in the ioctls.
Remove this rather pointless abstraction
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:30 +0000 (13:13 -0700)]
serial: move the flags into the tty_port field
Fortunately the serial layer was designed to use the same flag values but
with different names. It has its own SUSPENDED flag which is a free slot in
the ASYNC flags so we allocate it in the ASYNC flags instead.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:29 +0000 (13:13 -0700)]
serial: use tty_port pointers in the core code
Extract out a lot of the x.port. uses and also show up where there are
things left to be isolated that prevent use using the port helpers in the
serial layer at this point
Alan Cox [Sat, 19 Sep 2009 20:13:25 +0000 (13:13 -0700)]
vt: remove power stuff from kernel/power
In the past someone gratuitiously borrowed chunks of kernel internal vt
code and dumped them in kernel/power. They have all sorts of deep relations
with the vt code so put them in the vt tree instead
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:24 +0000 (13:13 -0700)]
vt: add an event interface
This is needed and requested in various forms for ConsoleKit, screenblank
handling and the like so do the job with a single interface. Also build the
interface so that unlike VT_WAITACTIVE and friends it won't miss events.
FIXME: Should this be a waitactive ioctl or a new device file you can poll
and read events from. We need the code anyway to fix up the existing broken
wait for console switch logic but the ConsoleKit people would prefer the
new device to the ioctl we have here
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:23 +0000 (13:13 -0700)]
tty: USB hangup is racy
The USB layer uses tty_hangup to deal with unplugs of the physical hardware
(analogous to loss of carrier) and then frees the resources. However the
tty_hangup is asynchronous. As the hangup can sleep we can use tty_vhangup
which is the non async version to avoid freeing resources too early.
Alan Cox [Sat, 19 Sep 2009 20:13:22 +0000 (13:13 -0700)]
tty: make the kref destructor occur asynchronously
We want to be able to sleep in the destructor for USB at least. It isn't a
hot path so just pushing it to a work queue doesn't really cause any
difficulty.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:20 +0000 (13:13 -0700)]
tty: Add a full port_close function
Now we are extracting out methods for shutdown and the like we can add a
proper tty_port_close method that knows all the innards of the tty closing
process and hides the lot from the caller.
At some point in the future this will be paired with a similar open()
helper and the drivers can stick to hardware management.
Anton Vorontsov [Sat, 19 Sep 2009 20:13:20 +0000 (13:13 -0700)]
8250: Now honours baud rate lower bounds
A platform clock drives 8250 ports in most SOC systems, the clock
might run at high frequencies, and so it's not always possible to
downscale uart clock to a desired value.
Currently the 8250 uart driver accepts not supported baud rates, and
what is worse, it is doing this silently, and then passes not accepted
values to a new termios, so userspace has no chance to catch this kind
of errors (userspace verifies that settings were accepted by reading
back and comparing the settings).
This patch fixes the issue by passing minimum baud rate to the
uart_get_baud_rate() call, the call should take care of all bounds,
so userspace should now report:
# stty -F /dev/ttyS0 speed 300
115200
stty: /dev/ttyS0: unable to perform all requested operations
p.s. uart_get_baud_rate() falls back to 9600, which still might be too
low for some 10 GHz platforms, but that's a separate issue, and
we can wait with fixing this till we find such a platform.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)]
kfifo: Use "const" definitions
Currently kfifo cannot be used by parts of the kernel that use "const"
properly as kfifo itself does not use const for passed data blocks which
are indeed const.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)]
slip: Clean up create and destroy
The network layer now has a destructor we can hook to clean up the slip
devices array. That needs us to initiate unregister events in the right
places which with the current tty layer we can do, and with network
refcounting is safe to do.
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add helpers for io operations, so that we can eliminate huge
amount of supporting code. It is now centralized in those
helpers and used values are precomputed in the init phase.
- save one indent level by inverting !fw_loaded condition
- read rs_status on Z and write it after we change all the flags,
don't do that separately
- remove Y inverted rts/dtr branching, precompute registers and use
them
- add a cy_ prefix to functions with changed prototypes
- cy_get_serial_info: initialize serial_struct by initializer,
save a memset
- inline simple functions (get_mon_info, {s,g}et_default_threshold,
{s,g}et_default_timeout) directly in the ioctl handler
- add a cy_cflags_changed helper to not copy its code by
wait_event_interruptible
- remove some ret_val = 0 assignments, it's preset to 0
- TIOCGICOUNT: don't do many put_user's, do one copy_to_user
- remove changelog from the file. we don't care about ancient
history
- update copyright year
- update version
- constify some stuff
- empty lines removal
- unused variables and macros removal
- remove some asm/ includes, they are sucked by linux/ variants
Use new tty helpers for close, which allows much code removal.
The only real change is locking. card_lock for protecting was
used inappropriately (just to have a critical section, no matter
which lock is used), so the change to port->lock is fine.
Remove also useless debug printks while being there.
Do not duplicate common tty_port_hangup code. Use it instead.
Also do not unset ASYNC_NORMAL_ACTIVE and wake up from the
tty_hangup() caller. It makes no sense since we don't check that
flag in sleepers. tty_port_hangup() performed later will do the
right job.
While this is not problem for Y card handlers (they are protected
by card_lock), Z handlers and other functions may dereference NULL
at any point after hangup/close. Even if (tty == NULL) was already
performed in the handler.
Note that it's not an issue for Y cards just for now. After
switching to tty_port_close_* et al. this will be a problem. So
add refcounting to them all.
Also proc .show doesn't take a tty reference and it should (along
with a ldisc one).
While at it and changing prototypes (adding tty param), prepend
cy_ to functions which don't have it yet.
Linus Torvalds [Mon, 3 Aug 2009 23:01:28 +0000 (16:01 -0700)]
tty-ldisc: get rid of tty_ldisc_try_get() helper function
Now that the /proc/tty/ldiscs handling doesn't play games with 'struct
ldisc' any more, the only remaining user of 'tty_ldisc_try_get()' is
'tty_ldisc_get()' (note the lack of 'try').
And we're actually much better off folding the logic directly into that
file, since the 'try' part was always about trying to get the ldisc
operations, not the ldisc itself: and making that explicit inside of
'tty_ldisc_get()' clarifies the whole semantics.
Linus Torvalds [Mon, 3 Aug 2009 23:00:15 +0000 (16:00 -0700)]
tty-ldisc: make /proc/tty/ldiscs use ldisc_ops instead of ldiscs
The /proc/tty/ldiscs file is totally and utterly un-interested in the
"struct tty_ldisc" structures, and only cares about the underlying ldisc
operations.
So don't make it create a dummy 'struct ldisc' only to get a pointer to
the operations, and then destroy it. Instead, we split up the function
'tty_ldisc_try_get()', and create a 'get_ldops()' helper that just looks
up the ldisc operations based on the ldisc number.
That makes the code simpler to read (smaller and more well-defined
helper functions), and allows the /proc functions to avoid creating that
useless dummy only to immediately free it again.
Mike Frysinger [Thu, 6 Aug 2009 22:20:05 +0000 (15:20 -0700)]
serial: bfin_5xx: fix building as module when early printk is enabled
Since early printk only makes sense/works when the serial driver is built
into the kernel, disable the option for this driver when it is going to be
built as a module. Otherwise we get build failures due to the ifdef
handling.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: stable <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tilman Schmidt [Fri, 7 Aug 2009 03:33:33 +0000 (20:33 -0700)]
tty: gigaset: really fix chars_in_buffer
The tty_operation chars_in_buffer() is not allowed to return a negative
value to signal an error. Corrects the problem flagged by commit 23198fda7182969b619613a555f8645fdc3dc334, "tty: fix chars_in_buffers".
Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: "David S. Miller" <davem@davemloft.net> Cc: stable <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arjan van de Ven [Sat, 19 Sep 2009 11:36:30 +0000 (13:36 +0200)]
perf utils: Use a define for the maximum length of a trace event
As per Ingo's review: use a #define rather than an open coded constant
for the maximum length of a trace event for storing in the perf.data file.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: fweisbec@gmail.com Cc: peterz@infradead.org Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20090919133630.10533d3e@infradead.org>
[ add a few comments to nearby functions ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 19 Sep 2009 11:36:04 +0000 (13:36 +0200)]
perf: Add timechart help text and add timechart to "perf help"
As suggested by Ingo, add a timechart man page help text, as well
as add it to the "perf help" overview.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: fweisbec@gmail.com Cc: peterz@infradead.org Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20090919133604.3767fa35@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 19 Sep 2009 11:35:33 +0000 (13:35 +0200)]
tracing, x86, cpuidle: Move the end point of a C state in the power tracer
The "end of a C state" trace point currently happens before
the code runs that corrects the TSC for having stopped during idle.
The result of this is that the timestamp of the end-of-C-state event
is garbage on cpus where the TSC stops during idle.
This patch moves the end point of the C state to after the timekeeping
engine of the kernel has been corrected.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Len Brown <len.brown@intel.com> Cc: fweisbec@gmail.com Cc: peterz@infradead.org Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20090919133533.139c2a46@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 19 Sep 2009 11:35:07 +0000 (13:35 +0200)]
perf utils: Be consistent about minimum text size in the svghelper
Be more consistent in the svghelper about the minimum text size
by having a global #define for this.
There needs to be a minimum text size in order to keep the size
of the SVG file within the reach of what current SVG viewers can
cope with.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: fweisbec@gmail.com Cc: peterz@infradead.org Cc: Paul Mackerras <paulus@samba.org> Cc: Arjan van de Ven <arjan@infradead.org>
LKML-Reference: <20090919133507.7374ef8b@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 19 Sep 2009 11:34:42 +0000 (13:34 +0200)]
perf timechart: Add "perf timechart record"
Add a command line option to record a trace, similar to "perf sched record".
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: fweisbec@gmail.com Cc: peterz@infradead.org Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20090919133442.0dc2c7f5@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 05:53:05 +0000 (07:53 +0200)]
perf: Add the timechart tool
timechart is a tool to visualize what is going on in the system.
The user makes a trace of what is going on with
> perf record --timechart /usr/bin/some_command
and then can turn the output of this into an svg file
> perf timechart
which then can be viewed with any SVG view; inkscape works well
enough for me.
The idea behind timechart is to create a "infinitely zoomable"
picture; something that has high level information on a 1:1 zoom
level, but which exposes more details every time you zoom into a
specific area.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130713.6a77bbc0@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 10:52:11 +0000 (12:52 +0200)]
perf: Add a SVG helper library file
The timechart tool writes out SVG format output; this patch adds a
set of helper functions to abstract dealing with SVG from the core
timechart code.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130613.677f0516@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Thu, 17 Sep 2009 14:11:28 +0000 (16:11 +0200)]
tracing, perf: Convert the power tracer into an event tracer
This patch converts the existing power tracer into an event tracer,
so that power events (C states and frequency changes) can be
tracked via "perf".
This also removes the perl script that was used to demo the tracer;
its functionality is being replaced entirely with timechart.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130542.6d314860@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 05:53:00 +0000 (07:53 +0200)]
perf: Add a sample_event type to the event_union
Add a sample_event type to the event_union so that raw samples can
be processed easily.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130511.411434b5@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 05:52:54 +0000 (07:52 +0200)]
perf: Allow perf utilities to have "callback" options without arguments
timechart needs to add a "callback" type command line argument that
does not take arguments.
This patch adds the parse-options.h infrastructure to make this
possible.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130440.548666c1@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 05:52:51 +0000 (07:52 +0200)]
perf: Store trace event name/id pairs in perf.data
The trace event name<->id mapping is dynamic for each kernel
compile. In order for perf.data to be useable outside the actual
system, we thus need to store a table of this mapping for later
use.
This patch adds this table to perf.data, and provides helper
functions for lookup up fields from this table.
To avoid mistakes, lookup-from-table is kept completely seprate
from lookup-from-local-debugfs.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130405.6960d099@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arjan van de Ven [Sat, 12 Sep 2009 05:52:47 +0000 (07:52 +0200)]
perf: Add a timestamp to fork events
perf timechart needs to know when a process forked, in order to be
able to visualize properly when tasks start.
This patch adds a time field to the event structure, and fills it
in appropriately.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130341.51ad2de2@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (38 commits)
x86: Move get/set_wallclock to x86_platform_ops
x86: platform: Fix section annotations
x86: apic namespace cleanup
x86: Distangle ioapic and i8259
x86: Add Moorestown early detection
x86: Add hardware_subarch ID for Moorestown
x86: Add early platform detection
x86: Move tsc_init to late_time_init
x86: Move tsc_calibration to x86_init_ops
x86: Replace the now identical time_32/64.c by time.c
x86: time_32/64.c unify profile_pc
x86: Move calibrate_cpu to tsc.c
x86: Make timer setup and global variables the same in time_32/64.c
x86: Remove mca bus ifdef from timer interrupt
x86: Simplify timer_ack magic in time_32.c
x86: Prepare unification of time_32/64.c
x86: Remove do_timer hook
x86: Add timer_init to x86_init_ops
x86: Move percpu clockevents setup to x86_init_ops
x86: Move xen_post_allocator_init into xen_pagetable_setup_done
...
Fix up conflicts in arch/x86/include/asm/io_apic.h
Geoffrey Thomas [Fri, 18 Sep 2009 19:52:09 +0000 (15:52 -0400)]
sparc: Clean up linker script using new linker script macros.
Signed-off-by: Geoffrey Thomas <geofft@ksplice.com> Signed-off-by: Tim Abbott <tabbott@ksplice.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nelson Elhage [Fri, 18 Sep 2009 19:52:08 +0000 (15:52 -0400)]
frv: clean up linker script using new linker script macros.
This is largely a straightforward conversion. The patch results in
fewer output sections, and some data being reordered, but should have
no functional impact.
Also, note that this patch moves some data (namely, init_task and
cacheline-aligned) inside [_sdata,_edata].
Because frv already builds using -ffunction-sections -fdata-sections,
we can't use BSS_SECTION or RW_DATA_SECTION yet, since they do not
currently include the required .bss.* and .data.* sections.
Signed-off-by: Nelson Elhage <nelhage@ksplice.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Tim Abbott <tabbott@ksplice.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nelson Elhage [Fri, 18 Sep 2009 19:52:07 +0000 (15:52 -0400)]
frv: remove unused .altinstructions code
It appears that frv copied the .altinstructions definitions in its linker
script from x86. Since frv doesn't put anything in those sections, this
is just dead code.
Signed-off-by: Nelson Elhage <nelhage@ksplice.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Tim Abbott <tabbott@ksplice.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>