aboutsummaryrefslogtreecommitdiffstats
path: root/tools/usb (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-05-24tools lib traceevent: Fix a possibly wrong memory dereferenceNamhyung Kim1-0/+2
If set_op_prio() failed, the token will be freed at out_free, then arg->op.op would turn out to be a dangle pointer. After returning EVENT_ERROR from process_op(), free_arg() will be called and then it will finally see the dangling pointer. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-13-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Fix a possible memory leakNamhyung Kim1-1/+4
If event_read_fields failed in the middle, each member of struct format_field should be freed also. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-11-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-24tools lib traceevent: Allow expressions in __print_symbolic() fieldsStefan Hajnoczi1-0/+7
The __print_symbolic() function takes a sequence of key-value pairs for pretty-printing a constant. The new kvm:kvm_exit print fmt uses the expression: __print_symbolic(..., { 0x040 + 1, "DB excp" }, ...) Currently only atoms are supported and this print fmt fails to parse. This patch adds support for expressions instead of just atoms so that 0x040 + 1 is parsed successfully. Cc: Avi Kivity <avi@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-6-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-23mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkagesMel Gorman1-24/+17
Dave Jones' system call fuzz testing tool "trinity" triggered the following bug error with slab debugging enabled ============================================================================= BUG numa_policy (Not tainted): Poison overwritten ----------------------------------------------------------------------------- INFO: 0xffff880146498250-0xffff880146498250. First byte 0x6a instead of 0x6b INFO: Allocated in mpol_new+0xa3/0x140 age=46310 cpu=6 pid=32154 __slab_alloc+0x3d3/0x445 kmem_cache_alloc+0x29d/0x2b0 mpol_new+0xa3/0x140 sys_mbind+0x142/0x620 system_call_fastpath+0x16/0x1b INFO: Freed in __mpol_put+0x27/0x30 age=46268 cpu=6 pid=32154 __slab_free+0x2e/0x1de kmem_cache_free+0x25a/0x260 __mpol_put+0x27/0x30 remove_vma+0x68/0x90 exit_mmap+0x118/0x140 mmput+0x73/0x110 exit_mm+0x108/0x130 do_exit+0x162/0xb90 do_group_exit+0x4f/0xc0 sys_exit_group+0x17/0x20 system_call_fastpath+0x16/0x1b INFO: Slab 0xffffea0005192600 objects=27 used=27 fp=0x (null) flags=0x20000000004080 INFO: Object 0xffff880146498250 @offset=592 fp=0xffff88014649b9d0 This implied a reference counting bug and the problem happened during mbind(). mbind() applies a new memory policy to a range and uses mbind_range() to merge existing VMAs or split them as necessary. In the event of splits, mpol_dup() will allocate a new struct mempolicy and maintain existing reference counts whose rules are documented in Documentation/vm/numa_memory_policy.txt . The problem occurs with shared memory policies. The vm_op->set_policy increments the reference count if necessary and split_vma() and vma_merge() have already handled the existing reference counts. However, policy_vma() screws it up by replacing an existing vma->vm_policy with one that potentially has the wrong reference count leading to a premature free. This patch removes the damage caused by policy_vma(). With this patch applied Dave's trinity tool runs an mbind test for 5 minutes without error. /proc/slabinfo reported that there are no numa_policy or shared_policy_node objects allocated after the test completed and the shared memory region was deleted. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Dave Jones <davej@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Stephen Wilson <wilsons@start.ca> Cc: Christoph Lameter <cl@linux.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <stable@vger.kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-23perf evlist: Explicititely initialize input_nameArnaldo Carvalho de Melo1-1/+1
It was a global variable, so it was initialized, implicitely, to zero by being placed in the bss. Now it is just a local variable that is then passed to the __cmd_evlist routine, so it must be explicitely set to NULL. The problem manifested on a Fedora 17 system, using: gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) But not on several other systems, by luck. Reported-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-5e8wolcjs3rgd5i6yi995gfh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-23ring-buffer: Check for valid buffer before changing sizeSteven Rostedt1-0/+5
On some machines the number of possible CPUS is not the same as the number of CPUs that is on the machine. Ftrace uses possible_cpus to update the tracing structures but the ring buffer only allocates per cpu buffers for online CPUs when they come up. When the wakeup tracer was enabled in such a case, the ftrace code enabled all possible cpu buffers, but the code in ring_buffer_resize() did not check to see if the buffer in question was allocated. Since boot up CPUs did not match possible CPUs it caused the following crash: BUG: unable to handle kernel NULL pointer dereference at 00000020 IP: [<c1097851>] ring_buffer_resize+0x16a/0x28d *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: [last unloaded: scsi_wait_scan] Pid: 1387, comm: bash Not tainted 3.4.0-test+ #13 /DG965MQ EIP: 0060:[<c1097851>] EFLAGS: 00010217 CPU: 0 EIP is at ring_buffer_resize+0x16a/0x28d EAX: f5a14340 EBX: f6026b80 ECX: 00000ff4 EDX: 00000ff3 ESI: 00000000 EDI: 00000002 EBP: f4275ecc ESP: f4275eb0 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 CR0: 80050033 CR2: 00000020 CR3: 34396000 CR4: 000007d0 DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 DR6: ffff0ff0 DR7: 00000400 Process bash (pid: 1387, ti=f4274000 task=f4380cb0 task.ti=f4274000) Stack: c109cf9a f6026b98 00000162 00160f68 00000006 00160f68 00000002 f4275ef0 c109d013 f4275ee8 c123b72a c1c0bf00 c1cc81dc 00000005 f4275f98 00000007 f4275f70 c109d0c7 7700000e 75656b61 00000070 f5e90900 f5c4e198 00000301 Call Trace: [<c109cf9a>] ? tracing_set_tracer+0x115/0x1e9 [<c109d013>] tracing_set_tracer+0x18e/0x1e9 [<c123b72a>] ? _copy_from_user+0x30/0x46 [<c109d0c7>] tracing_set_trace_write+0x59/0x7f [<c10ec01e>] ? fput+0x18/0x1c6 [<c11f8732>] ? security_file_permission+0x27/0x2b [<c10eaacd>] ? rw_verify_area+0xcf/0xf2 [<c10ec01e>] ? fput+0x18/0x1c6 [<c109d06e>] ? tracing_set_tracer+0x1e9/0x1e9 [<c10ead77>] vfs_write+0x8b/0xe3 [<c10ebead>] ? fget_light+0x30/0x81 [<c10eaf54>] sys_write+0x42/0x63 [<c1834fbf>] sysenter_do_call+0x12/0x28 This happens with the latency tracer as the ftrace code updates the saved max buffer via its cpumask and not with a global setting. Adding a check in ring_buffer_resize() to make sure the buffer being resized exists, fixes the problem. Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-23Revert "sched, perf: Use a single callback into the scheduler"Jiri Olsa3-17/+30
This reverts commit cb04ff9ac424 ("sched, perf: Use a single callback into the scheduler"). Before this change was introduced, the process switch worked like this (wrt. to perf event schedule): schedule (prev, next) - schedule out all perf events for prev - switch to next - schedule in all perf events for current (next) After the commit, the process switch looks like: schedule (prev, next) - schedule out all perf events for prev - schedule in all perf events for (next) - switch to next The problem is, that after we schedule perf events in, the pmu is enabled and we can receive events even before we make the switch to next - so "current" still being prev process (event SAMPLE data are filled based on the value of the "current" process). Thats exactly what we see for test__PERF_RECORD test. We receive SAMPLES with PID of the process that our tracee is scheduled from. Discussed with Peter Zijlstra: > Bah!, yeah I guess reverting is the right thing for now. Sad > though. > > So by having the two hooks we have a black-spot between them > where we receive no events at all, this black-spot covers the > hand-over of current and we thus don't receive the 'wrong' > events. > > I rather liked we could do away with both that black-spot and > clean up the code a little, but apparently people rely on it. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: acme@redhat.com Cc: paulus@samba.org Cc: cjashfor@linux.vnet.ibm.com Cc: fweisbec@gmail.com Cc: eranian@google.com Link: http://lkml.kernel.org/r/20120523111302.GC1638@m.brq.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-05-23Documentation/watchdog: Fix the file descriptor leak when no cmdline arg givenDevendra Naga1-0/+11
we start a infinite loop when user gives ./watchdog-test, and when user ctrl + c's the program, we just exit immeadiately with out closing the filedescriptor of the watchdog device. a signal handler is used to do the job of closing the filedescriptor and exiting the program. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Documentation/watchdog: close the fd when cmdline arg givenDevendra Naga1-3/+6
in the watchdog test code, the ioctl is performed on the watchdog device and just doing exit(0) so we leak a filedescripor. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Documentation/watchdog: Fix a small typoDevendra Naga1-1/+1
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: s3c2410_wdt: Set timeout to actually achieved timeoutHans de Goede1-1/+1
While rebasing my "watchdog_dev: Let the driver update the timeout field on set_timeout success" patch (before I noticed it was already picked up by Wim), I noticed that the s3c2410_wdt driver may not always have a 1 second resolution, this patch changes s3c2410wdt_set_heartbeat to update the timeout to the actually achieved timeout. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: wm831x: Convert to gpio_request_one()Mark Brown1-10/+3
Use the more modern API. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: via_wdt: depends on PCIRandy Dunlap1-1/+1
via_wdt is a PCI driver so it should depend on PCI so that it will not cause build errors. drivers/watchdog/via_wdt.c:256:1: warning: data definition has no type or storage class drivers/watchdog/via_wdt.c:256:1: warning: type defaults to 'int' in declaration of 'module_pci_driver' drivers/watchdog/via_wdt.c:256:1: warning: parameter names (without types) in function declaration Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ie6xx_wdt needs io.hRandy Dunlap1-0/+1
Fix build error by including <linux/io.h>: drivers/watchdog/ie6xx_wdt.c:97:2: error: implicit declaration of function 'outb' drivers/watchdog/ie6xx_wdt.c:133:2: error: implicit declaration of function 'outl' drivers/watchdog/ie6xx_wdt.c:161:2: error: implicit declaration of function 'inb' drivers/watchdog/ie6xx_wdt.c:199:3: error: implicit declaration of function 'inl' drivers/watchdog/ie6xx_wdt.c:203:3: error: implicit declaration of function 'inw' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ie6xx_wdt.c: fix printk format warningRandy Dunlap1-2/+2
Fix printk format warning; use cast to u64 since resource_size_t can be either u32 or u64. drivers/watchdog/ie6xx_wdt.c:261:4: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'resource_size_t' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: Add watchdog driver for Intel Atom E6XXAlexander Stein3-0/+361
Add driver for the watchdog timer built into the Intel Atom E6XX (TunnelCreek) processor. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: it87_wdt: Add support for IT8728F watchdog.Diego Elio Pettenò2-3/+11
This works the same way IT8721F works, but it supports WDT_PWROK (checked on the datasheet). Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: i6300esb: don't depend on X86Michael Olbrich1-1/+1
i6300esb is on of the watchdogs QEMU can emulate. It is also available when emulating ARM. The driver works without problems and is quite useful to test userspace dealing with /dev/watchdog. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: Use module_pci_driverWim Van Sebroeck5-88/+9
This patch converts the PCI watchdog drivers so that they use the module_pci_driver() macro. This makes the code smaller and simpler. Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: Thomas Mingarelli <thomas.mingarelli@hp.com> Cc: Marc Vertes <marc.vertes@sigfox.com>
2012-05-23ktest: Change singular "paranthesis" to plural "parentheses"Jesper Juhl1-1/+1
Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-23watchdog: sch311x_wdt.c: Remove RESGENDave Mueller1-34/+5
The SCH311x chip contains 2 watchdogs. One is the watchdog programmable by the runtime register at address 0x65-0x68, the other is the watchdog inside the power on reset generator. This second watchdog has a fixed timeout value of ~1.6 seconds and is configurable only by the RESGEN register. The BIOS normally takes care of the RESGEN watchdog and disables it (at least) before the OS is booted. Unfortunately the sch311x_wdt driver clears bit 0 of the RESGEN register which has the effect that at the latest 1.6 seconds later, a POR is triggered. The attached patch fixes this problem by completely removing any reference to the RESGEN watchdog from the sch311x_wdt driver. Signed-off-by: Dave Mueller <d.mueller@elsoft.ch> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: s3c2410-wdt: Use of_match_ptr().Wim Van Sebroeck1-3/+2
Use of_match_ptr definition for the of_match_table. Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2012-05-23watchdog: Device tree support for pnx4008-wdtRoland Stigge2-0/+23
This patch adds device tree support to pnx4008-wdt.c Signed-off-by: Roland Stigge <stigge@antcom.de> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: ar7_wdt.c: use devm_request_and_ioremapJulia Lawall1-23/+10
Combine request_region and ioremap into devm_request_and_ioremap. This has the effect of fixing a missing iounmap on the failure of clk_get. This also introduces a call to clk_put and clears the vbus_clk variable in the case of failure or device removal. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: remove ixp2000 driverRob Herring3-227/+0
The platform is removed, so there are no users of this driver. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23watchdog: sp5100_tco.c: quiet sparse noise about using plain integer was NULL pointerH Hartley Sweeten1-1/+1
Pointers should not be compared to plain integers. Quiets the sparse warning: warning: Using plain integer as NULL pointer Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-23Guard check in module loader against integer overflowDavid Howells1-1/+2
The check: if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) may not work if there's an overflow in the right-hand side of the condition. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23modpost: use proper kernel style for autogenerated filesGreg Kroah-Hartman1-4/+4
If the kernel build process is creating files automatically, the least it can do is create them in a properly formatted manner. Sure, it's a minor issue, but being consistent is nice. Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Alessio Igor Bogani <abogani@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23modpost: Stop grab_file() from leaking filedescriptors if fstat() failsJesper Juhl1-3/+6
In case the open() call succeeds but the subsequent fstat() call fails, then we'll return without close()'ing the filedescriptor. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-23regmap: Use select .. if to get IRQ_DOMAIN enabledMark Brown2-3/+1
Ensure that we can't get randconfig breakage by doing the IRQ_DOMAIN select automatically. Don't just do the select from REGMAP_IRQ to ensure that the select actually gets noticed. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-22various Kconfig cleanup and old platform build code removalRichard Kuo2-22/+4
Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22hexagon/mm/vm_fault.c: Port OOM changes to do_page_faultKautuk Consul1-5/+17
Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99 (mm: retry page fault when blocking on disk transfer) and commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb (x86,mm: make pagefault killable) The above commits introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to hexagon. Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22arch/hexagon/kernel/dma.c: make function staticJulia Lawall1-1/+1
This function is only used in the same file, and the other similar functions in this file are also static. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [rkuo@codeaurora.org: adjusted patch to apply to latest] Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22Remove unneeded include of version.h from arch/hexagon/include/asm/spinlock_types.hJesper Juhl1-2/+0
"make versioncheck" points out that arch/hexagon/include/asm/spinlock_types.h does not need to include version.h . A quick look at the file seems to confirm its findings, so here's a patch that removes the include. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22Hexagon: Use resource_size functionThomas Meyer1-4/+2
Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
2012-05-22PATA host controller driver for ep93xxRafal Prylowski3-0/+1054
Add PATA host controller driver for ep93xx. Signed-off-by: Rafal Prylowski <prylowski@metasoft.pl> Cc: Joao Ramos <joao.ramos@inov.pt> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ryan Mallon <rmallon@gmail.com> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22[libata] Add " 2GB ATA Flash Disk"/"ADMA428M" to DMA blacklistPrarit Bhargava1-0/+1
A user has several systems with a couple of models of flash disks with IDE connectors. These disks work fine in 2.6.18-ish kernels but corrupt data on new kernels. The difference appears to be with the default I/O method used by the IDE controller driver between the kernels. In the older kernels, the configuration is very conservative and the driver stays in PIO mode. With new kernels, the ata driver (pata_serverworks) attempts to use UDMA/66 which the drive claims to support. This mode, however, does not appear to work in DMA mode. The drive does work correctly and no corruption is seen if the kernel parameter "libata.force=5:pio0,6:pio0" is used to force the driver to use PIO instead of DMA mode. Blacklist these drives. Unfortunately the model name of the drive is very generic, " 2GB ATA Flash Disk", but the revision is specific, "ADMA428M". Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22ata_generic: Skip is_intel_ider() check when ata_generic=1 is setAndi Kleen1-1/+1
When ata_generic_ide=1 is set don't do the is_intel_ider() magic check. We found at least one box who needed that. Cc: alan@linux.intel.com Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22epoll: Fix user space breakage related to EPOLLWAKEUPRafael J. Wysocki1-1/+1
Commit 4d7e30d (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready) caused some applications to malfunction, because they set the bit corresponding to the new EPOLLWAKEUP flag in their eventpoll flags and they don't have the new CAP_EPOLLWAKEUP capability. To prevent that from happening, change epoll_ctl() to clear EPOLLWAKEUP in epds.events if the caller doesn't have the CAP_EPOLLWAKEUP capability instead of failing and returning an error code, which allows the affected applications to function normally. Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-05-22perf evlist: Show event attribute detailsArnaldo Carvalho de Melo2-11/+100
There was no easy way to see the frequency used, and with the change of default, we better provide one. [root@sandy linux]# perf evlist -F cycles: sample_freq=4000 [root@sandy linux]# perf evlist -v cycles: sample_freq=4000, size: 80, sample_type: 391, read_format: 7, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, sample_id_all: 1, exclude_guest: 1 [root@sandy linux]# Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-e1p9poez3nwrgycbmwqmhlsu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: Bump default sample freq to 4 kHzArnaldo Carvalho de Melo2-2/+2
Quoting Ingo: "While at it I'd also suggest increasing the default sampling frequency, from 1000 Hz per CPU to at least 4Khz auto-freq or so - this should work well all across the board I think. CPUs are getting faster and command/app run times are getting shorter, 1Khz is a bit low IMO." Requested-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-2jafa6mkrufyekny9ei59lpu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf buildid-list: Work better with pipe modeStephane Eranian2-1/+7
In order for perf buildid-list to work with pipe-mode files, it needs to process buildids and event attr structs. $ perf record -o - noploop 2 | ./perf inject -b | perf buildid-list -i - -H noploop for 2 seconds [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.084 MB - (~3678 samples) ] 0000000000000000000000000000000000000000 [kernel.kallsyms] 3a0d0629efe74a8da3eeba372cdbd74ad9b8f5d5 /usr/local/bin/noploop The reason [kernel.kallsyms] shows a 0 build-id comes from the way buildids are injected in the stream. The buildid for the kernel is provided by a BUILD_ID record. The [kernel.kallsyms] is provided by a MMAP record. There is no clean and obvious way to link the two, unfortunately. In regular mode, the kernel buildid is generated from reading the ELF image or kallsyms and perf knows to associate [kernel.kallsyms] to it. Later on, when perf processes the [kernel.kallsyms] MMAP record, it will already have a dso for it. So for now, make sure perf buildid-list shows the buildids for everything but the kernel image. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1337081295-10303-6-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: Fix piped mode read codeStephane Eranian1-8/+26
In __perf_session__process_pipe_events(), there was a risk we would read more than what a union perf_event struct can hold. this could happen in case, perf is reading a file which contains new record types it does not know about and which are larger than anything it knows about. In general, perf is supposed to skip records it does not understand, but in pipe mode, those have to be read and ignored. The fixed size header contains the size of the record, but that size may be larger than union perf_event, yet it was used as the backing to the read in: union perf_event event; void *p; size = event->header.size; p = &event; p += sizeof(struct perf_event_header); if (size - sizeof(struct perf_event_header)) { err = readn(self->fd, p, size - sizeof(struct perf_event_header)); We fix this by allocating a buffer based on the size reported in the header. We reuse the buffer as much as we can. We realloc in case it becomes too small. In the common case, the performance impact is negligible. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1337081295-10303-3-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf inject: Fix broken perf inject -bStephane Eranian1-0/+5
perf inject -b was broken. It would not inject any build_id into the stream. Furthermore, it would strip samples from the stream. The reason was a missing initialization of the event attribute structure. The perf_tool.tool.attr() callback was pointing to a simple repipe. But there was no initialization of the internal data structures to keep track of events and event ids. That later caused event id lookups to fail, and sample would get removed. The patch simply adds back the call to perf_event__process_attr() to initialize the evlist structure and now build_ids are again injected. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1337081295-10303-2-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATAStephane Eranian3-8/+8
To match the PERF_RECORD_HEADER_TRACING_DATA record type. This is the same info as the one used for pipe mode whereas the other one is for regular file output. This will help in the later patch to add meta-data infos in pipe mode. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1337081295-10303-4-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: Add union u64_swap type for swapping u64 dataJiri Olsa2-8/+7
The following union: union { u64 val64; u32 val32[2]; } u; is used on more than one place in perf code and will be used more in upcomming patches. Adding union u64_swap to have it defined globaly so we dont need to redefine it all the time. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: David Ahern <dsahern@gmail.com> Tested-by: David Ahern <dsahern@gmail.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337151548-2396-4-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: Carry perf_event_attr bitfield throught different endiansJiri Olsa1-0/+34
When the perf data file is read cross architectures, the perf_event__attr_swap function takes care about endianness of all the struct fields except the bitfield flags. The bitfield flags need to be transformed as well, since the bitfield binary storage differs for both endians. ABI says: Bit-fields are allocated from right to left (least to most significant) on little-endian implementations and from left to right (most to least significant) on big-endian implementations. The above seems to be byte specific, so we need to reverse each byte of the bitfield. 'Internet' also says this might be implementation specific and we probably need proper fix and carry perf_event_attr bitfield flags in separate data file FEAT_ section. Thought this seems to work for now. Note, running following to test perf endianity handling: test 1) - origin system: # perf record -a -- sleep 10 (any perf record will do) # perf report > report.origin # perf archive perf.data - copy the perf.data, report.origin and perf.data.tar.bz2 to a target system and run: # tar xjvf perf.data.tar.bz2 -C ~/.debug # perf report > report.target # diff -u report.origin report.target - the diff should produce no output (besides some white space stuff and possibly different date/TZ output) test 2) - origin system: # perf record -ag -fo /tmp/perf.data -- sleep 1 - mount origin system root to the target system on /mnt/origin - target system: # perf script --symfs /mnt/origin -I -i /mnt/origin/tmp/perf.data \ --kallsyms /mnt/origin/proc/kallsyms - complete perf.data header is displayed Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: David Ahern <dsahern@gmail.com> Tested-by: David Ahern <dsahern@gmail.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337151548-2396-3-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf record: Fix documentation for branch stack samplingAnshuman Khandual1-1/+1
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Acked-by: Stephane Eranian <eranian@google.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/4FB60C7A.2080508@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf target: Add cpu flag to sample_type if target has cpuNamhyung Kim2-1/+4
Add PERF_SAMPLE_CPU flag into attr->sample_type if an user specified any of cpu target (either system-wide or cpu list). It will show correct values when cpu sort key is given for perf top and perf report. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337564527-9367-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-22perf tools: Always try to build libtraceeventNamhyung Kim1-2/+2
Although perf depends on the libtraceevent, it cannot know when it needs to be rebuilt. So just try to rebuild it always in order to make sure we use the latest version. While at it, silence annoying directory change messages. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1337677434-4881-2-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>