linux.kernel - 26 new messages in 19 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* memcg: dirty pages instrumentation - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/98b8f3d66410be44?hl=en
* compal-laptop: Make it depend on CONFIG_RFKILL - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/483853d08e1ad890?hl=en
* NOHZ vs. profile/oprofile v2 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/79bb21849045ad73?hl=en
* Gianfar driver failing on MPC8641D based board - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/e7119195208a2974?hl=en
* sparc: use asm-generic/scatterlist.h - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/18cde759295738d0?hl=en
* serial: Add OMAP high-speed UART driver. - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/367b898833e91d7d?hl=en
* [PATCH 7/7] xen: Enable grant table and xenbus for PV extension of HVM - 2
messages, 2 authors
http://groups.google.com/group/linux.kernel/t/fbe37dafcb007f26?hl=en
* nfs: use 4*rsize readahead size - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0ded33f7779e13c7?hl=en
* rcu: suppress RCU lockdep warnings during early boot - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/793bcd4fc844361a?hl=en
* perf_events: add sampling period randomization support - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/54108222cc877582?hl=en
* Google Gerrit - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/24f53a863abcc323?hl=en
* tracing: fix warning in s_next - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/7e5be06cf5b04dec?hl=en
* [TRIVIAL] kbuild - tags - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/5b822894f555143d?hl=en
* Rework of msrpm optimization and additional fixes for nested svm - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/195270d735d890a7?hl=en
* arch/x86/kvm/kvm_timer.h: Checkpatch cleanup - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/e0ce05b42ac96287?hl=en
* perf_events, x86: Fixup fixed counter constraints - 3 messages, 1 author
http://groups.google.com/group/linux.kernel/t/ccab234928070dfe?hl=en
* Add ID and STREAM_ID to recorded event data - 5 messages, 1 author
http://groups.google.com/group/linux.kernel/t/27a851ce9714f443?hl=en
* [RFC] Add multiple event support to perf report - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/cbdcd8149372496f?hl=en
* powerpc: implement arch_scale_smt_power for Power7 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/891f3a14ac88e3fb?hl=en
==============================================================================
TOPIC: memcg: dirty pages instrumentation
http://groups.google.com/group/linux.kernel/t/98b8f3d66410be44?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:00 am
From: "Kirill A. Shutemov"
On Tue, Mar 2, 2010 at 3:47 PM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> * Andrea Righi <arighi@develer.com> [2010-03-01 22:23:40]:
>
>> Apply the cgroup dirty pages accounting and limiting infrastructure to
>> the opportune kernel functions.
>>
>> Signed-off-by: Andrea Righi <arighi@develer.com>
>> ---
>> fs/fuse/file.c | 5 +++
>> fs/nfs/write.c | 4 ++
>> fs/nilfs2/segment.c | 10 +++++-
>> mm/filemap.c | 1 +
>> mm/page-writeback.c | 84 ++++++++++++++++++++++++++++++++------------------
>> mm/rmap.c | 4 +-
>> mm/truncate.c | 2 +
>> 7 files changed, 76 insertions(+), 34 deletions(-)
>>
>> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
>> index a9f5e13..dbbdd53 100644
>> --- a/fs/fuse/file.c
>> +++ b/fs/fuse/file.c
>> @@ -11,6 +11,7 @@
>> #include <linux/pagemap.h>
>> #include <linux/slab.h>
>> #include <linux/kernel.h>
>> +#include <linux/memcontrol.h>
>> #include <linux/sched.h>
>> #include <linux/module.h>
>>
>> @@ -1129,6 +1130,8 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
>>
>> list_del(&req->writepages_entry);
>> dec_bdi_stat(bdi, BDI_WRITEBACK);
>> + mem_cgroup_update_stat(req->pages[0],
>> + MEM_CGROUP_STAT_WRITEBACK_TEMP, -1);
>> dec_zone_page_state(req->pages[0], NR_WRITEBACK_TEMP);
>> bdi_writeout_inc(bdi);
>> wake_up(&fi->page_waitq);
>> @@ -1240,6 +1243,8 @@ static int fuse_writepage_locked(struct page *page)
>> req->inode = inode;
>>
>> inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK);
>> + mem_cgroup_update_stat(tmp_page,
>> + MEM_CGROUP_STAT_WRITEBACK_TEMP, 1);
>> inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
>> end_page_writeback(page);
>>
>> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
>> index b753242..7316f7a 100644
>> --- a/fs/nfs/write.c
>> +++ b/fs/nfs/write.c
>
> Don't need memcontrol.h to be included here?
It's included in <linux/swap.h>
> Looks OK to me overall, but there might be objection using the
> mem_cgroup_* naming convention, but I don't mind it very much :)
>
> --
> Three Cheers,
> Balbir
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
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/
==============================================================================
TOPIC: compal-laptop: Make it depend on CONFIG_RFKILL
http://groups.google.com/group/linux.kernel/t/483853d08e1ad890?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:00 am
From: Ingo Molnar
Hi,
* Matthew Garrett <mjg@redhat.com> wrote:
> compal-laptop: Add support for known Compal made Dell laptops
> compal-laptop: Replace sysfs support with rfkill support
FYI, -tip testing found a (relatively rare) build failure introduced by these
commits, which occurs with certain .config's - see the fix below. Please
apply.
Thanks,
Ingo
--------------------------->
From a6e5fbf2d4b6e9f78abcc5784f23403aa7972369 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Tue, 2 Mar 2010 14:51:16 +0100
Subject: [PATCH] compal-laptop: Make it depend on CONFIG_RFKILL
-tip testing found this build failure (x86 randconfig):
drivers/built-in.o: In function `setup_rfkill':
compal-laptop.c:(.text+0x36abe8): undefined reference to `rfkill_alloc'
compal-laptop.c:(.text+0x36abfc): undefined reference to `rfkill_register'
compal-laptop.c:(.text+0x36ac30): undefined reference to `rfkill_alloc'
compal-laptop.c:(.text+0x36ac44): undefined reference to `rfkill_register'
Which can happen with CONFIG_COMPAL_LAPTOP=y but COMPAL_LAPTOP=m.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
drivers/platform/x86/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 89da3e2..56076ee 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -178,6 +178,7 @@ config COMPAL_LAPTOP
tristate "Compal Laptop Extras"
depends on ACPI
depends on BACKLIGHT_CLASS_DEVICE
+ depends on RFKILL
---help---
This is a driver for laptops built by Compal:
--
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/
==============================================================================
TOPIC: NOHZ vs. profile/oprofile v2
http://groups.google.com/group/linux.kernel/t/79bb21849045ad73?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:00 am
From: Aaro Koskinen
Hi,
Martin Schwidefsky wrote:
> First version of the hrtimer patch for oprofile. I did not add the
> sysctl yet, if the sysctl is added in oprofile_timer_init it would not
> be available if some better profiling source is available. If it is
> added unconditionally it would only have an effect if the timer
> fallback is used. Both cases are not exactly nice for a user space
> interface.
I wonder what happened to this patch? Some platforms would need
this fix (i.e. the timer mode has to be used due to HW issues).
> ---
> Subject: [PATCH] convert oprofile from timer_hook to hrtimer
>
> From: Martin Schwidefsky <schwidefsky@de.ibm.com>
>
> Oprofile is currently broken on systems running with NOHZ enabled.
> A maximum of 1 tick is accounted via the timer_hook if a cpu sleeps
> for a longer period of time. This does bad things to the percentages
> in the profiler output. To solve this problem convert oprofile to
> use a restarting hrtimer instead of the timer_hook.
>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> ---
>
> drivers/oprofile/oprof.c | 12 ++++--
> drivers/oprofile/oprof.h | 3 +
> drivers/oprofile/timer_int.c | 77 +++++++++++++++++++++++++++++++++++++------
> 3 files changed, 78 insertions(+), 14 deletions(-)
>
> diff -urpN linux-2.6/drivers/oprofile/oprof.c linux-2.6-patched/drivers/oprofile/oprof.c
> --- linux-2.6/drivers/oprofile/oprof.c 2009-06-24 17:21:12.000000000 +0200
> +++ linux-2.6-patched/drivers/oprofile/oprof.c 2009-06-24 17:18:28.000000000 +0200
> @@ -184,22 +184,26 @@ static int __init oprofile_init(void)
> int err;
>
> err = oprofile_arch_init(&oprofile_ops);
> -
> if (err < 0 || timer) {
> printk(KERN_INFO "oprofile: using timer interrupt.\n");
> - oprofile_timer_init(&oprofile_ops);
> + err = oprofile_timer_init(&oprofile_ops);
> + if (err)
> + goto out_arch;
> }
> -
> err = oprofilefs_register();
> if (err)
> - oprofile_arch_exit();
> + goto out_arch;
> + return 0;
>
> +out_arch:
> + oprofile_arch_exit();
> return err;
> }
>
>
> static void __exit oprofile_exit(void)
> {
> + oprofile_timer_exit();
> oprofilefs_unregister();
> oprofile_arch_exit();
> }
> diff -urpN linux-2.6/drivers/oprofile/oprof.h linux-2.6-patched/drivers/oprofile/oprof.h
> --- linux-2.6/drivers/oprofile/oprof.h 2009-06-24 17:21:12.000000000 +0200
> +++ linux-2.6-patched/drivers/oprofile/oprof.h 2009-06-24 17:19:11.000000000 +0200
> @@ -32,7 +32,8 @@ struct super_block;
> struct dentry;
>
> void oprofile_create_files(struct super_block *sb, struct dentry *root);
> -void oprofile_timer_init(struct oprofile_operations *ops);
> +int oprofile_timer_init(struct oprofile_operations *ops);
> +void oprofile_timer_exit(void);
>
> int oprofile_set_backtrace(unsigned long depth);
>
> diff -urpN linux-2.6/drivers/oprofile/timer_int.c linux-2.6-patched/drivers/oprofile/timer_int.c
> --- linux-2.6/drivers/oprofile/timer_int.c 2009-06-24 17:21:12.000000000 +0200
> +++ linux-2.6-patched/drivers/oprofile/timer_int.c 2009-06-24 17:18:44.000000000 +0200
> @@ -13,34 +13,93 @@
> #include <linux/oprofile.h>
> #include <linux/profile.h>
> #include <linux/init.h>
> +#include <linux/cpu.h>
> +#include <linux/hrtimer.h>
> +#include <asm/irq_regs.h>
> #include <asm/ptrace.h>
>
> #include "oprof.h"
>
> -static int timer_notify(struct pt_regs *regs)
> +static DEFINE_PER_CPU(struct hrtimer, oprofile_hrtimer);
> +
> +static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer)
> +{
> + oprofile_add_sample(get_irq_regs(), 0);
> + hrtimer_forward_now(hrtimer, ns_to_ktime(TICK_NSEC));
> + return HRTIMER_RESTART;
> +}
> +
> +static void __oprofile_hrtimer_start(void *unused)
> +{
> + struct hrtimer *hrtimer = &__get_cpu_var(oprofile_hrtimer);
> +
> + hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> + hrtimer->function = oprofile_hrtimer_notify;
> +
> + hrtimer_start(hrtimer, ns_to_ktime(TICK_NSEC),
> + HRTIMER_MODE_REL_PINNED);
> +}
> +
> +static int oprofile_hrtimer_start(void)
> {
> - oprofile_add_sample(regs, 0);
> + on_each_cpu(__oprofile_hrtimer_start, NULL, 1);
> return 0;
> }
>
> -static int timer_start(void)
> +static void __oprofile_hrtimer_stop(int cpu)
> {
> - return register_timer_hook(timer_notify);
> + struct hrtimer *hrtimer = &per_cpu(oprofile_hrtimer, cpu);
> +
> + hrtimer_cancel(hrtimer);
> }
>
> +static void oprofile_hrtimer_stop(void)
> +{
> + int cpu;
> + for_each_online_cpu(cpu)
> + __oprofile_hrtimer_stop(cpu);
> +}
>
> -static void timer_stop(void)
> +static int __cpuinit oprofile_cpu_notify(struct notifier_block *self,
> + unsigned long action, void *hcpu)
> {
> - unregister_timer_hook(timer_notify);
> + long cpu = (long) hcpu;
> +
> + switch (action) {
> + case CPU_ONLINE:
> + case CPU_ONLINE_FROZEN:
> + smp_call_function_single(cpu, __oprofile_hrtimer_start,
> + NULL, 1);
> + break;
> + case CPU_DEAD:
> + case CPU_DEAD_FROZEN:
> + __oprofile_hrtimer_stop(cpu);
> + break;
> + }
> + return NOTIFY_OK;
> }
>
> +static struct notifier_block __refdata oprofile_cpu_notifier = {
> + .notifier_call = oprofile_cpu_notify,
> +};
>
> -void __init oprofile_timer_init(struct oprofile_operations *ops)
> +int __init oprofile_timer_init(struct oprofile_operations *ops)
> {
> + int rc;
> +
> + rc = register_hotcpu_notifier(&oprofile_cpu_notifier);
> + if (rc)
> + return rc;
> ops->create_files = NULL;
> ops->setup = NULL;
> ops->shutdown = NULL;
> - ops->start = timer_start;
> - ops->stop = timer_stop;
> + ops->start = oprofile_hrtimer_start;
> + ops->stop = oprofile_hrtimer_stop;
> ops->cpu_type = "timer";
> + return 0;
> +}
> +
> +void __exit oprofile_timer_exit(void)
> +{
> + unregister_hotcpu_notifier(&oprofile_cpu_notifier);
> }
>
> ---
>
--
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/
==============================================================================
TOPIC: Gianfar driver failing on MPC8641D based board
http://groups.google.com/group/linux.kernel/t/e7119195208a2974?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:10 am
From: Anton Vorontsov
Hi!
On Sat, Feb 27, 2010 at 11:05:32AM +0530, Kumar Gopalpet-B05799 wrote:
[...]
> Understood, and thanks for the explanation. Am I correct in saying that
> this is
> due to the out-of-order execution capability on powerpc ?
Nope, that was just a logic issue in the driver.
Though, with the patch, the eieio() is needed so that compiler (or CPU)
won't reorder lstatus and skbuff writes.
> I have one more question, why don't we use use atomic_t for num_txbdfree
> and
> completely do away with spin_locks in gfar_clean_tx_ring() and
> gfar_start_xmit().
> In an non-SMP, scenario I would feel there is absolutely no requirement
> of spin_locks
> and in case of SMP atomic operation would be much more safer on powerpc
> rather than spin_locks.
>
> What is your suggestion ?
I think that's a good idea.
However, in start_xmit() we'll have to keep the spinlock anyway
since it also protects from gfar_error(), which can modify
regs->tstat.
Thanks!
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
--
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/
==============================================================================
TOPIC: sparc: use asm-generic/scatterlist.h
http://groups.google.com/group/linux.kernel/t/18cde759295738d0?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:10 am
From: FUJITA Tomonori
On Tue, 02 Mar 2010 05:55:34 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Tue, 2 Mar 2010 14:54:11 +0100
>
> > Broken in the sense that arch/powerpc/Kconfig describes CONFIG_IOMMU_VMERGE:
> >
> > Cause IO segments sent to a device for DMA to be merged virtually
> > by the IOMMU when they happen to have been allocated contiguously.
> > This doesn't add pressure to the IOMMU allocator. However, some
> > drivers don't support getting large merged segments coming back
> > from *_map_sg().
> >
> > Most drivers don't have this problem; it is safe to say Y here.
> >
> > I don't know if this comment still applies to any drivers in the mainline
> > kernel, but it's possible.
>
> That really has to be out of date these days.
Yeah, I think so.
I added dma_get_max_seg_size() several years ago so that device drives
can tell IOMMU about the maximum segment length that they can
handle. And the default limit (64K) should work for everyone, I think.
I guess that the comment was written when IOMMU was able to merge as
many segments as possible with ignoring the device limitation.
--
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/
==============================================================================
TOPIC: serial: Add OMAP high-speed UART driver.
http://groups.google.com/group/linux.kernel/t/367b898833e91d7d?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:10 am
From: "Shilimkar, Santosh"
<snip snip>
> > > --
> > CDAC is a shadow register used for monitoring the DMA channel.
> > I think it would be a lot
> > simpler if omap_start_dma() always resets CDAC to 0, and the
> > UART driver
> > just not set it explicitly.
>
> This seems to be better option than exposing CDAC read/write API
> to other drivers since user need to write '0' before starting any DMA
> transfer which can be be done in omap_start_dma().
>
> I am wondering how other drivers are using DMA transfer API's without
> resetting CDAC to zero.
>
It's needed only if some one is interested in that count. UART seems to
using this counter where as other driver don't.
Why do you think drivers need to know about counter value ?
Regards,
Santosh
--
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/
==============================================================================
TOPIC: [PATCH 7/7] xen: Enable grant table and xenbus for PV extension of HVM
http://groups.google.com/group/linux.kernel/t/fbe37dafcb007f26?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Mar 2 2010 6:10 am
From: Konrad Rzeszutek Wilk
On Tue, Mar 02, 2010 at 09:21:43AM +0800, Sheng Yang wrote:
> On Tuesday 02 March 2010 01:38:58 Konrad Rzeszutek Wilk wrote:
> > > +/* The region reserved by QEmu for Xen platform device */
> > > +#define GNTTAB_START 0xf2000000ul
> > > +#define GNTTAB_SIZE 0x20000ul
> >
> > I thought that in the earlier review you said:
> >
> > "> > +#define GNTTAB_START 0xfbfe0000ul
> >
> > > > +#define GNTTAB_SIZE 0x20000ul
> > >
> > > Is it possible that there would be a PCI device that would be
> > > passed in the guest that would conflict with the above mentioned
> > > E820 region?
> >
> > I would change them to a dedicated PCI MMIO address in the next version.
> > Thanks.
> >
> > "
> > ?
>
> And yes, this is the dedicated PCI MMIO address I mentioned.. I would update
> the comments to get it more clear.
>
> I don't think it's very clear solution, because the real good way to do this
> is probe pci device and find out with one is the platform pci device then use
> it. But the grant table initialization is quite earlier compared to the
> possible probing now... I hardcode the position now, and hunting for a better
Would it be possible to move the grant table initialization to later
phase? Past the PCI loading/initialization?
> idea.
>
> Comments?
>
> --
> regards
> Yang, Sheng
>
--
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/
== 2 of 2 ==
Date: Tues, Mar 2 2010 6:20 am
From: Ian Campbell
On Tue, 2010-03-02 at 13:41 +0000, Konrad Rzeszutek Wilk wrote:
> On Tue, Mar 02, 2010 at 09:21:43AM +0800, Sheng Yang wrote:
> > On Tuesday 02 March 2010 01:38:58 Konrad Rzeszutek Wilk wrote:
> > > > +/* The region reserved by QEmu for Xen platform device */
> > > > +#define GNTTAB_START 0xf2000000ul
> > > > +#define GNTTAB_SIZE 0x20000ul
> > >
> > > I thought that in the earlier review you said:
> > >
> > > "> > +#define GNTTAB_START 0xfbfe0000ul
> > >
> > > > > +#define GNTTAB_SIZE 0x20000ul
> > > >
> > > > Is it possible that there would be a PCI device that would be
> > > > passed in the guest that would conflict with the above mentioned
> > > > E820 region?
> > >
> > > I would change them to a dedicated PCI MMIO address in the next version.
> > > Thanks.
> > >
> > > "
> > > ?
> >
> > And yes, this is the dedicated PCI MMIO address I mentioned.. I would update
> > the comments to get it more clear.
> >
> > I don't think it's very clear solution, because the real good way to do this
> > is probe pci device and find out with one is the platform pci device then use
> > it. But the grant table initialization is quite earlier compared to the
> > possible probing now... I hardcode the position now, and hunting for a better
>
> Would it be possible to move the grant table initialization to later
> phase? Past the PCI loading/initialization?
Or provide the address via an MSR, hypervisor specific CPUID leaf or IO
port or by using the early_pci infrastructure in the kernel. I don't
think we are short of options ;-)
Ian.
>
> > idea.
> >
> > Comments?
> >
> > --
> > regards
> > Yang, Sheng
> >
--
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/
==============================================================================
TOPIC: nfs: use 4*rsize readahead size
http://groups.google.com/group/linux.kernel/t/0ded33f7779e13c7?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:20 am
From: Trond Myklebust
On Tue, 2010-03-02 at 11:10 +0800, Wu Fengguang wrote:
> Dave,
>
> Here is one more test on a big ext4 disk file:
>
> 16k 39.7 MB/s
> 32k 54.3 MB/s
> 64k 63.6 MB/s
> 128k 72.6 MB/s
> 256k 71.7 MB/s
> rsize ==> 512k 71.7 MB/s
> 1024k 72.2 MB/s
> 2048k 71.0 MB/s
> 4096k 73.0 MB/s
> 8192k 74.3 MB/s
> 16384k 74.5 MB/s
>
> It shows that >=128k client side readahead is enough for single disk
> case :) As for RAID configurations, I guess big server side readahead
> should be enough.
There are lots of people who would like to use NFS on their company WAN,
where you typically have high bandwidths (up to 10GigE), but often a
high latency too (due to geographical dispersion).
My ping latency from here to a typical server in NetApp's Bangalore
office is ~ 312ms. I read your test results with 10ms delays, but have
you tested with higher than that?
Cheers
Trond
--
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/
==============================================================================
TOPIC: rcu: suppress RCU lockdep warnings during early boot
http://groups.google.com/group/linux.kernel/t/793bcd4fc844361a?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:20 am
From: Ingo Molnar
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> On Tue, Mar 02, 2010 at 01:20:59PM +0100, Ingo Molnar wrote:
> >
> > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> >
> > > + if (!rcu_scheduler_active || !debug_locks)
> > > + return 1;
> > > + return lock_is_held(&rcu_lock_map);
> >
> > > + if (!rcu_scheduler_active || !debug_locks)
> > > + return 1;
> > > + return lock_is_held(&rcu_bh_lock_map);
> >
> > i guess there could be a common helper here?
>
> Will do!
>
> > Also, could we clear rcu_scheduler_active when we clear debug_locks? That way
> > only a single test is needed, a generic 'is lock debugging active'.
>
> Doing that will break synchronize_rcu(), which returns immediately if
> !rcu_scheduler_active.
Ok - then have an debug_rcu flag which is cleared appropriately - so that the
fastpath impact is reduced?
Ingo
--
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/
==============================================================================
TOPIC: perf_events: add sampling period randomization support
http://groups.google.com/group/linux.kernel/t/54108222cc877582?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:20 am
From: Robert Richter
On 02.03.10 12:41:18, Peter Zijlstra wrote:
> On Tue, 2010-03-02 at 11:53 +0100, Robert Richter wrote:
> >
> > Only adding the random value will lead to longer sample periods on
> > average. To compensate this you could calculate something like:
> >
> > event->hw.sample_period = event->attr.sample_period + (new_seed & mask) - (mask >> 1);
>
> Or cheat and do something like:
>
> sample_period ^= (new_seed & mask);
This wont work, it will be asymmetric, e.g. for
(event->attr.sample_period & mask) == 0
the offset would be always positive. Only for
(event->attr.sample_period & mask) == (mask & ~(mask >> 1))
it is correct.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com
--
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/
==============================================================================
TOPIC: Google Gerrit
http://groups.google.com/group/linux.kernel/t/24f53a863abcc323?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:20 am
From: Anca Emanuel
Hi, what do you think about Google Gerrit ? http://code.google.com/p/gerrit/
see it in action here: http://review.source.android.com
quote:
"Gerrit is a web based code review system, facilitating online code
reviews for projects using the Git version control system.
Gerrit makes reviews easier by showing changes in a side-by-side
display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any
authorized user to submit changes to the master Git repository, rather
than requiring all approved changes to be merged in by hand by the
project maintainer. This functionality enables a more centralized
usage of Git."
git needs an friendly UI, web based is the future.
Maybe an integration with Wave.
--
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/
==============================================================================
TOPIC: tracing: fix warning in s_next
http://groups.google.com/group/linux.kernel/t/7e5be06cf5b04dec?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:40 am
From: Steven Rostedt
On Tue, 2010-03-02 at 17:54 +0800, Lai Jiangshan wrote:
> This warning in s_next() can be triggered by lseek():
> [<c018b3f7>] ? s_next+0x77/0x80
> [<c013e3c1>] warn_slowpath_common+0x81/0xa0
> [<c018b3f7>] ? s_next+0x77/0x80
> [<c013e3fa>] warn_slowpath_null+0x1a/0x20
> [<c018b3f7>] s_next+0x77/0x80
> [<c01efa77>] traverse+0x117/0x200
> [<c01eff13>] seq_lseek+0xa3/0x120
> [<c01efe70>] ? seq_lseek+0x0/0x120
> [<c01d7081>] vfs_llseek+0x41/0x50
> [<c01d8116>] sys_llseek+0x66/0xa0
> [<c0102bd0>] sysenter_do_call+0x12/0x26
>
> It is because s_start() calls s_next() without reset leftover.
Applied, Thanks!
-- Steve
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 032c57c..5edf410 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -1703,6 +1703,7 @@ static void *s_start(struct seq_file *m, loff_t *pos)
>
> ftrace_enable_cpu();
>
> + iter->leftover = 0;
> for (p = iter; p && l < *pos; p = s_next(m, p, &l))
> ;
>
--
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/
==============================================================================
TOPIC: [TRIVIAL] kbuild - tags
http://groups.google.com/group/linux.kernel/t/5b822894f555143d?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:40 am
From: John Kacur
- Fix spelling error in comment (is->if)
Signed-off-by: John Kacur <jkacur@redhat.com>
---
scripts/tags.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 1a0c44d..a6a8e71 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -17,7 +17,7 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
-name .git ) \
-prune -o"
-# Do not use full path is we do not use O=.. builds
+# Do not use full path if we do not use O=.. builds
if [ "${KBUILD_SRC}" = "" ]; then
tree=
else
--
1.6.6.1
--
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/
==============================================================================
TOPIC: Rework of msrpm optimization and additional fixes for nested svm
http://groups.google.com/group/linux.kernel/t/195270d735d890a7?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:40 am
From: Marcelo Tosatti
On Mon, Mar 01, 2010 at 03:34:33PM +0100, Joerg Roedel wrote:
> Hi,
>
> this is the third round of the msrpm merge optimization patches for
> nested svm. The change to the previous post it the introduction of an
> direc_access_msrs list which contains all msrs that a guest might
> directly access. This list is used to initialize the msrpm bitmaps and
> the msrpm_offset table used for merging two tables. This optimization
> more than doubles the performance of kernel compiles in the nested guest
> using nested-shadow paging.
> The other random fixes in this set were not changed to the last version
> of this set. Patch 1/7 is new because it was forgotten in the last post.
>
> Thanks,
>
> Joerg
Applied, thanks.
--
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/
==============================================================================
TOPIC: arch/x86/kvm/kvm_timer.h: Checkpatch cleanup
http://groups.google.com/group/linux.kernel/t/e0ce05b42ac96287?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 6:40 am
From: Marcelo Tosatti
On Sat, Feb 27, 2010 at 05:51:43PM +0100, Andrea Gelmini wrote:
> arch/x86/kvm/kvm_timer.h:13: ERROR: code indent should use tabs where possible
>
> Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
> ---
> arch/x86/kvm/kvm_timer.h | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
Applied, thanks.
--
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/
==============================================================================
TOPIC: perf_events, x86: Fixup fixed counter constraints
http://groups.google.com/group/linux.kernel/t/ccab234928070dfe?hl=en
==============================================================================
== 1 of 3 ==
Date: Tues, Mar 2 2010 6:40 am
From: tip-bot for Peter Zijlstra
Commit-ID: b622d644c7d61a5cb95b74e7b143c263bed21f0a
Gitweb: http://git.kernel.org/tip/b622d644c7d61a5cb95b74e7b143c263bed21f0a
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Mon, 1 Feb 2010 15:36:30 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 2 Mar 2010 15:06:47 +0100
perf_events, x86: Fixup fixed counter constraints
Patch 1da53e0230 ("perf_events, x86: Improve x86 event scheduling")
lost us one of the fixed purpose counters and then ed8777fc13
("perf_events, x86: Fix event constraint masks") broke it even
further.
Widen the fixed event mask to event+umask and specify the full config
for each of the 3 fixed purpose counters. Then let the init code fill
out the placement for the GP regs based on the cpuid info.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/perf_event.h | 2 +-
arch/x86/kernel/cpu/perf_event.c | 25 ++++++++++++++++++-------
arch/x86/kernel/cpu/perf_event_intel.c | 31 +++++++++++++++++++++----------
3 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index 80e6936..db6109a 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -50,7 +50,7 @@
INTEL_ARCH_INV_MASK| \
INTEL_ARCH_EDGE_MASK|\
INTEL_ARCH_UNIT_MASK|\
- INTEL_ARCH_EVTSEL_MASK)
+ INTEL_ARCH_EVENT_MASK)
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index aab2e1c..bfc43fa 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -73,10 +73,10 @@ struct debug_store {
struct event_constraint {
union {
unsigned long idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
- u64 idxmsk64[1];
+ u64 idxmsk64;
};
- int code;
- int cmask;
+ u64 code;
+ u64 cmask;
int weight;
};
@@ -103,7 +103,7 @@ struct cpu_hw_events {
};
#define __EVENT_CONSTRAINT(c, n, m, w) {\
- { .idxmsk64[0] = (n) }, \
+ { .idxmsk64 = (n) }, \
.code = (c), \
.cmask = (m), \
.weight = (w), \
@@ -116,7 +116,7 @@ struct cpu_hw_events {
EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVTSEL_MASK)
#define FIXED_EVENT_CONSTRAINT(c, n) \
- EVENT_CONSTRAINT(c, n, INTEL_ARCH_FIXED_MASK)
+ EVENT_CONSTRAINT(c, (1ULL << (32+n)), INTEL_ARCH_FIXED_MASK)
#define EVENT_CONSTRAINT_END \
EVENT_CONSTRAINT(0, 0, 0)
@@ -615,8 +615,8 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
bitmap_zero(used_mask, X86_PMC_IDX_MAX);
for (i = 0; i < n; i++) {
- constraints[i] =
- x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
+ c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
+ constraints[i] = c;
}
/*
@@ -1350,6 +1350,7 @@ static void __init pmu_check_apic(void)
void __init init_hw_perf_events(void)
{
+ struct event_constraint *c;
int err;
pr_info("Performance Events: ");
@@ -1398,6 +1399,16 @@ void __init init_hw_perf_events(void)
__EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_events) - 1,
0, x86_pmu.num_events);
+ if (x86_pmu.event_constraints) {
+ for_each_event_constraint(c, x86_pmu.event_constraints) {
+ if (c->cmask != INTEL_ARCH_FIXED_MASK)
+ continue;
+
+ c->idxmsk64 |= (1ULL << x86_pmu.num_events) - 1;
+ c->weight += x86_pmu.num_events;
+ }
+ }
+
pr_info("... version: %d\n", x86_pmu.version);
pr_info("... bit width: %d\n", x86_pmu.event_bits);
pr_info("... generic registers: %d\n", x86_pmu.num_events);
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index cf6590c..4fbdfe5 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -1,7 +1,7 @@
#ifdef CONFIG_CPU_SUP_INTEL
/*
- * Intel PerfMon v3. Used on Core2 and later.
+ * Intel PerfMon, used on Core and later.
*/
static const u64 intel_perfmon_event_map[] =
{
@@ -27,8 +27,14 @@ static struct event_constraint intel_core_event_constraints[] =
static struct event_constraint intel_core2_event_constraints[] =
{
- FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
- FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+ FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+ FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+ /*
+ * Core2 has Fixed Counter 2 listed as CPU_CLK_UNHALTED.REF and event
+ * 0x013c as CPU_CLK_UNHALTED.BUS and specifies there is a fixed
+ * ratio between these counters.
+ */
+ /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
@@ -37,14 +43,16 @@ static struct event_constraint intel_core2_event_constraints[] =
INTEL_EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
INTEL_EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
INTEL_EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
+ INTEL_EVENT_CONSTRAINT(0xc9, 0x1), /* ITLB_MISS_RETIRED (T30-9) */
INTEL_EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
EVENT_CONSTRAINT_END
};
static struct event_constraint intel_nehalem_event_constraints[] =
{
- FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
- FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+ FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+ FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+ /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
INTEL_EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
INTEL_EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
INTEL_EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
@@ -58,8 +66,9 @@ static struct event_constraint intel_nehalem_event_constraints[] =
static struct event_constraint intel_westmere_event_constraints[] =
{
- FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
- FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+ FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+ FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+ /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */
INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
@@ -68,8 +77,9 @@ static struct event_constraint intel_westmere_event_constraints[] =
static struct event_constraint intel_gen_event_constraints[] =
{
- FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
- FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+ FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+ FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+ /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
EVENT_CONSTRAINT_END
};
@@ -935,7 +945,7 @@ static __init int intel_pmu_init(void)
x86_pmu.event_constraints = intel_nehalem_event_constraints;
pr_cont("Nehalem/Corei7 events, ");
break;
- case 28:
+ case 28: /* Atom */
memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
sizeof(hw_cache_event_ids));
@@ -951,6 +961,7 @@ static __init int intel_pmu_init(void)
x86_pmu.event_constraints = intel_westmere_event_constraints;
pr_cont("Westmere events, ");
break;
+
default:
/*
* default constraints for v2 and up
--
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/
== 2 of 3 ==
Date: Tues, Mar 2 2010 6:40 am
From: tip-bot for Peter Zijlstra
Commit-ID: 5671a10e2bc7f99d9157c6044faf8be2ef302361
Gitweb: http://git.kernel.org/tip/5671a10e2bc7f99d9157c6044faf8be2ef302361
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Tue, 2 Mar 2010 14:20:14 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 2 Mar 2010 15:02:05 +0100
nmi_watchdog: Tell the world we're active
Because I was wondering why perf stat wasn't working as expected..
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Don Zickus <dzickus@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/nmi_watchdog.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/nmi_watchdog.c b/kernel/nmi_watchdog.c
index 0a6f57f..a79d211 100644
--- a/kernel/nmi_watchdog.c
+++ b/kernel/nmi_watchdog.c
@@ -244,6 +244,8 @@ static int __init spawn_nmi_watchdog_task(void)
if (nonmi_watchdog)
return 0;
+ printk(KERN_INFO "NMI watchdog enabled, takes one hw-pmu counter.\n");
+
err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
if (err == NOTIFY_BAD) {
BUG();
--
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/
== 3 of 3 ==
Date: Tues, Mar 2 2010 6:40 am
From: tip-bot for Peter Zijlstra
Commit-ID: 320ebf09cbb6d01954c9a060266aa8e0d27f4638
Gitweb: http://git.kernel.org/tip/320ebf09cbb6d01954c9a060266aa8e0d27f4638
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Tue, 2 Mar 2010 12:35:37 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 2 Mar 2010 15:06:46 +0100
perf, x86: Restrict the ANY flag
The ANY flag can show SMT data of another task (like 'top'),
so we want to disable it when system-wide profiling is
disabled.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/cpu/perf_event.c | 3 +++
include/linux/perf_event.h | 15 +++++++++++++++
kernel/perf_event.c | 15 ---------------
3 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 6531b4b..aab2e1c 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -503,6 +503,9 @@ static int __hw_perf_event_init(struct perf_event *event)
*/
if (attr->type == PERF_TYPE_RAW) {
hwc->config |= x86_pmu.raw_event(attr->config);
+ if ((hwc->config & ARCH_PERFMON_EVENTSEL_ANY) &&
+ perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
+ return -EACCES;
return 0;
}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 04f06b4..90e0521 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -857,6 +857,21 @@ extern int sysctl_perf_event_paranoid;
extern int sysctl_perf_event_mlock;
extern int sysctl_perf_event_sample_rate;
+static inline bool perf_paranoid_tracepoint_raw(void)
+{
+ return sysctl_perf_event_paranoid > -1;
+}
+
+static inline bool perf_paranoid_cpu(void)
+{
+ return sysctl_perf_event_paranoid > 0;
+}
+
+static inline bool perf_paranoid_kernel(void)
+{
+ return sysctl_perf_event_paranoid > 1;
+}
+
extern void perf_event_init(void);
extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size);
extern void perf_bp_event(struct perf_event *event, void *data);
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a661e79..482d5e1 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -56,21 +56,6 @@ static atomic_t nr_task_events __read_mostly;
*/
int sysctl_perf_event_paranoid __read_mostly = 1;
-static inline bool perf_paranoid_tracepoint_raw(void)
-{
- return sysctl_perf_event_paranoid > -1;
-}
-
-static inline bool perf_paranoid_cpu(void)
-{
- return sysctl_perf_event_paranoid > 0;
-}
-
-static inline bool perf_paranoid_kernel(void)
-{
- return sysctl_perf_event_paranoid > 1;
-}
-
int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */
/*
--
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/
==============================================================================
TOPIC: Add ID and STREAM_ID to recorded event data
http://groups.google.com/group/linux.kernel/t/27a851ce9714f443?hl=en
==============================================================================
== 1 of 5 ==
Date: Tues, Mar 2 2010 6:50 am
From: Eric B Munson
Currently perf record does not write the ID or the STREAM_ID to disk
for events. This doesn't allow report to tell if an event stream contains
one or more types of events. This patch adds these two entries to the list
of data that record will write to disk.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
tools/perf/builtin-record.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 771533c..35e4605 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -242,7 +242,8 @@ static void create_counter(int counter, int cpu, pid_t pid)
PERF_FORMAT_TOTAL_TIME_RUNNING |
PERF_FORMAT_ID;
- attr->sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+ attr->sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
+ PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID;
if (freq) {
attr->sample_type |= PERF_SAMPLE_PERIOD;
--
1.6.3.3
--
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/
== 2 of 5 ==
Date: Tues, Mar 2 2010 6:50 am
From: Eric B Munson
This patch adds the structures necessary to count each event type
independently in perf report.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
tools/perf/util/event.h | 9 +++++++++
tools/perf/util/session.c | 1 +
tools/perf/util/session.h | 1 +
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 50a7132..a33b949 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -99,6 +99,15 @@ struct events_stats {
u64 lost;
};
+struct event_stat_id {
+ struct rb_node rb_node;
+ struct rb_root hists;
+ struct events_stats stats;
+ u64 config;
+ u64 event_stream;
+ u32 type;
+};
+
void event__print_totals(void);
struct perf_session;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0de7258..eed1cb8 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -70,6 +70,7 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc
memcpy(self->filename, filename, len);
self->threads = RB_ROOT;
+ self->stats_by_id = RB_ROOT;
self->last_match = NULL;
self->mmap_window = 32;
self->cwd = NULL;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 31950fc..5c33417 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -20,6 +20,7 @@ struct perf_session {
struct thread *last_match;
struct map *vmlinux_maps[MAP__NR_TYPES];
struct events_stats events_stats;
+ struct rb_root stats_by_id;
unsigned long event_total[PERF_RECORD_MAX];
unsigned long unknown_events;
struct rb_root hists;
--
1.6.3.3
--
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/
== 3 of 5 ==
Date: Tues, Mar 2 2010 6:50 am
From: Eric B Munson
Perf report does not handle multiple events being recorded even
though perf record stores them properly on disk. This patch
addresses that issue by adding the logic to perf report to use
the event stream id that is saved by record and the new data
structures to seperate the event streams and report them
individually.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
tools/perf/builtin-report.c | 105 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 92 insertions(+), 13 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index cd16e6a..dcfb565 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -45,29 +45,71 @@ static char *pretty_printing_style = default_pretty_printing_style;
static char callchain_default_opt[] = "fractal,0.5";
+static struct event_stat_id *get_stats(struct perf_session *self, u64 event_stream,
+ u32 type, u64 config)
+{
+ struct rb_node **p = &self->stats_by_id.rb_node;
+ struct rb_node *parent = NULL;
+ struct event_stat_id *iter, *new;
+
+ while (*p != NULL) {
+ parent = *p;
+ iter = rb_entry(parent, struct event_stat_id, rb_node);
+ if (iter->config == config) {
+ return iter;
+ }
+
+ if (config > iter->config)
+ p = &(*p)->rb_right;
+ else
+ p = &(*p)->rb_left;
+ }
+
+ new = malloc(sizeof(struct event_stat_id));
+ if (new == NULL)
+ return NULL;
+ memset(new, 0, sizeof(struct event_stat_id));
+ new->event_stream = event_stream;
+ new->config = config;
+ new->type = type;
+ rb_link_node(&new->rb_node, parent, p);
+ rb_insert_color(&new->rb_node, &self->stats_by_id);
+ return new;
+}
+
static int perf_session__add_hist_entry(struct perf_session *self,
struct addr_location *al,
- struct ip_callchain *chain, u64 count)
+ struct sample_data *data)
{
struct symbol **syms = NULL, *parent = NULL;
bool hit;
struct hist_entry *he;
+ struct event_stat_id *stats;
+ struct perf_event_attr *attr;
- if ((sort__has_parent || symbol_conf.use_callchain) && chain)
+ if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain)
syms = perf_session__resolve_callchain(self, al->thread,
- chain, &parent);
- he = __perf_session__add_hist_entry(&self->hists, al, parent,
- count, &hit);
+ data->callchain, &parent);
+
+ attr = perf_header__find_attr(data->id, &self->header);
+ if (attr)
+ stats = get_stats(self, data->id, attr->type, attr->config);
+ else
+ stats = get_stats(self, data->id, 0, 0);
+ if (stats == NULL)
+ return -ENOMEM;
+ he = __perf_session__add_hist_entry(&stats->hists, al, parent,
+ data->period, &hit);
if (he == NULL)
return -ENOMEM;
if (hit)
- he->count += count;
+ he->count += data->period;
if (symbol_conf.use_callchain) {
if (!hit)
callchain_init(&he->callchain);
- append_chain(&he->callchain, chain, syms);
+ append_chain(&he->callchain, data->callchain, syms);
free(syms);
}
@@ -87,10 +129,29 @@ static int validate_chain(struct ip_callchain *chain, event_t *event)
return 0;
}
+static int add_event_total(struct perf_session *session, struct sample_data *data,
+ struct perf_event_attr *attr)
+{
+ struct event_stat_id *stats;
+
+ if (attr)
+ stats = get_stats(session, data->id, attr->type, attr->config);
+ else
+ stats = get_stats(session, data->id, 0, 0);
+
+ if (!stats)
+ return -ENOMEM;
+
+ stats->stats.total += data->period;
+ session->events_stats.total += data->period;
+ return 0;
+}
+
static int process_sample_event(event_t *event, struct perf_session *session)
{
struct sample_data data = { .period = 1, };
struct addr_location al;
+ struct perf_event_attr *attr;
event__parse_sample(event, session->sample_type, &data);
@@ -124,12 +185,18 @@ static int process_sample_event(event_t *event, struct perf_session *session)
if (al.filtered || (hide_unresolved && al.sym == NULL))
return 0;
- if (perf_session__add_hist_entry(session, &al, data.callchain, data.period)) {
+ if (perf_session__add_hist_entry(session, &al, &data)) {
pr_debug("problem incrementing symbol count, skipping event\n");
return -1;
}
- session->events_stats.total += data.period;
+ attr = perf_header__find_attr(data.id, &session->header);
+
+ if (add_event_total(session, &data, attr)) {
+ pr_debug("problem adding event count\n");
+ return -1;
+ }
+
return 0;
}
@@ -198,6 +265,7 @@ static int __cmd_report(void)
{
int ret = -EINVAL;
struct perf_session *session;
+ struct rb_node *next;
session = perf_session__new(input_name, O_RDONLY, force);
if (session == NULL)
@@ -225,10 +293,21 @@ static int __cmd_report(void)
if (verbose > 2)
dsos__fprintf(stdout);
- perf_session__collapse_resort(session);
- perf_session__output_resort(session, session->events_stats.total);
- fprintf(stdout, "# Samples: %Ld\n#\n", session->events_stats.total);
- perf_session__fprintf_hists(session, NULL, false, stdout);
+ next = rb_first(&session->stats_by_id);
+ while (next) {
+ struct event_stat_id *stats = rb_entry(next,
+ struct event_stat_id,
+ rb_node);
+ perf_session__collapse_resort(&stats->hists);
+ perf_session__output_resort(&stats->hists, stats->stats.total);
+ fprintf(stdout, "# Samples: %Ld %s\n#\n", stats->stats.total,
+ __event_name(stats->type, stats->config));
+ perf_session__fprintf_hists(&stats->hists, NULL, false, stdout,
+ stats->stats.total);
+ fprintf(stdout, "\n\n");
+ next = rb_next(&stats->rb_node);
+ }
+
if (sort_order == default_sort_order &&
parent_pattern == default_parent_pattern)
fprintf(stdout, "#\n# (For a higher level overview, try: perf report --sort comm,dso)\n#\n");
--
1.6.3.3
--
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/
== 4 of 5 ==
Date: Tues, Mar 2 2010 6:50 am
From: Eric B Munson
In order to minimize the impact of storing multiple events in a report
this function will now take the root of the histogram tree so that the
logic for selecting the proper tree can be inserted before the call.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-diff.c | 3 ++-
tools/perf/builtin-report.c | 3 ++-
tools/perf/util/hist.c | 6 +++---
tools/perf/util/hist.h | 3 ++-
5 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5ec5de9..4b734c7 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -116,7 +116,7 @@ static int perf_session__add_hist_entry(struct perf_session *self,
return 0;
}
- he = __perf_session__add_hist_entry(self, al, NULL, count, &hit);
+ he = __perf_session__add_hist_entry(&self->hists, al, NULL, count, &hit);
if (he == NULL)
return -ENOMEM;
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 18b3f50..20df735 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -26,7 +26,8 @@ static int perf_session__add_hist_entry(struct perf_session *self,
struct addr_location *al, u64 count)
{
bool hit;
- struct hist_entry *he = __perf_session__add_hist_entry(self, al, NULL,
+ struct hist_entry *he = __perf_session__add_hist_entry(&self->hists,
+ al, NULL,
count, &hit);
if (he == NULL)
return -ENOMEM;
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index cfc655d..cd16e6a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -56,7 +56,8 @@ static int perf_session__add_hist_entry(struct perf_session *self,
if ((sort__has_parent || symbol_conf.use_callchain) && chain)
syms = perf_session__resolve_callchain(self, al->thread,
chain, &parent);
- he = __perf_session__add_hist_entry(self, al, parent, count, &hit);
+ he = __perf_session__add_hist_entry(&self->hists, al, parent,
+ count, &hit);
if (he == NULL)
return -ENOMEM;
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index e8daf5c..55dd911 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -12,12 +12,12 @@ struct callchain_param callchain_param = {
* histogram, sorted on item, collects counts
*/
-struct hist_entry *__perf_session__add_hist_entry(struct perf_session *self,
+struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists,
struct addr_location *al,
struct symbol *sym_parent,
u64 count, bool *hit)
{
- struct rb_node **p = &self->hists.rb_node;
+ struct rb_node **p = &hists->rb_node;
struct rb_node *parent = NULL;
struct hist_entry *he;
struct hist_entry entry = {
@@ -53,7 +53,7 @@ struct hist_entry *__perf_session__add_hist_entry(struct perf_session *self,
return NULL;
*he = entry;
rb_link_node(&he->rb_node, parent, p);
- rb_insert_color(&he->rb_node, &self->hists);
+ rb_insert_color(&he->rb_node, hists);
*hit = false;
return he;
}
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index e5f99b2..7b48590 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -10,8 +10,9 @@ struct perf_session;
struct hist_entry;
struct addr_location;
struct symbol;
+struct rb_root;
-struct hist_entry *__perf_session__add_hist_entry(struct perf_session *self,
+struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists,
struct addr_location *al,
struct symbol *parent,
u64 count, bool *hit);
--
1.6.3.3
--
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/
== 5 of 5 ==
Date: Tues, Mar 2 2010 6:50 am
From: Eric B Munson
Now that report can store historgrams for multiple events we need
to be able to do the post processing work for each histogram.
This patch changes the post processing functions so that they can
be called individually for each event's histogram.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
tools/perf/builtin-annotate.c | 4 ++--
tools/perf/builtin-diff.c | 9 +++++----
tools/perf/util/hist.c | 39 ++++++++++++++++++++-------------------
tools/perf/util/hist.h | 9 +++++----
4 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4b734c7..6ad7148 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -564,8 +564,8 @@ static int __cmd_annotate(void)
if (verbose > 2)
dsos__fprintf(stdout);
- perf_session__collapse_resort(session);
- perf_session__output_resort(session, session->event_total[0]);
+ perf_session__collapse_resort(&session->hists);
+ perf_session__output_resort(&session->hists, session->event_total[0]);
perf_session__find_annotations(session);
out_delete:
perf_session__delete(session);
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 20df735..d2781fb 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -115,7 +115,7 @@ static void perf_session__resort_hist_entries(struct perf_session *self)
static void perf_session__set_hist_entries_positions(struct perf_session *self)
{
- perf_session__output_resort(self, self->events_stats.total);
+ perf_session__output_resort(&self->hists, self->events_stats.total);
perf_session__resort_hist_entries(self);
}
@@ -167,13 +167,14 @@ static int __cmd_diff(void)
goto out_delete;
}
- perf_session__output_resort(session[1], session[1]->events_stats.total);
+ perf_session__output_resort(&(session[1]->hists), session[1]->events_stats.total);
if (show_displacement)
perf_session__set_hist_entries_positions(session[0]);
perf_session__match_hists(session[0], session[1]);
- perf_session__fprintf_hists(session[1], session[0],
- show_displacement, stdout);
+ perf_session__fprintf_hists(&(session[1]->hists), session[0],
+ show_displacement, stdout,
+ session[1]->events_stats.total);
out_delete:
for (i = 0; i < 2; ++i)
perf_session__delete(session[i]);
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 55dd911..73ebb6f 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -130,7 +130,7 @@ static void collapse__insert_entry(struct rb_root *root, struct hist_entry *he)
rb_insert_color(&he->rb_node, root);
}
-void perf_session__collapse_resort(struct perf_session *self)
+void perf_session__collapse_resort(struct rb_root *hists)
{
struct rb_root tmp;
struct rb_node *next;
@@ -140,17 +140,17 @@ void perf_session__collapse_resort(struct perf_session *self)
return;
tmp = RB_ROOT;
- next = rb_first(&self->hists);
+ next = rb_first(hists);
while (next) {
n = rb_entry(next, struct hist_entry, rb_node);
next = rb_next(&n->rb_node);
- rb_erase(&n->rb_node, &self->hists);
+ rb_erase(&n->rb_node, hists);
collapse__insert_entry(&tmp, n);
}
- self->hists = tmp;
+ *hists = tmp;
}
/*
@@ -183,7 +183,7 @@ static void perf_session__insert_output_hist_entry(struct rb_root *root,
rb_insert_color(&he->rb_node, root);
}
-void perf_session__output_resort(struct perf_session *self, u64 total_samples)
+void perf_session__output_resort(struct rb_root *hists, u64 total_samples)
{
struct rb_root tmp;
struct rb_node *next;
@@ -194,18 +194,18 @@ void perf_session__output_resort(struct perf_session *self, u64 total_samples)
total_samples * (callchain_param.min_percent / 100);
tmp = RB_ROOT;
- next = rb_first(&self->hists);
+ next = rb_first(hists);
while (next) {
n = rb_entry(next, struct hist_entry, rb_node);
next = rb_next(&n->rb_node);
- rb_erase(&n->rb_node, &self->hists);
+ rb_erase(&n->rb_node, hists);
perf_session__insert_output_hist_entry(&tmp, n,
min_callchain_hits);
}
- self->hists = tmp;
+ *hists = tmp;
}
static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)
@@ -456,10 +456,10 @@ static size_t hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
}
static size_t hist_entry__fprintf(struct hist_entry *self,
- struct perf_session *session,
struct perf_session *pair_session,
bool show_displacement,
- long displacement, FILE *fp)
+ long displacement, FILE *fp,
+ u64 session_total)
{
struct sort_entry *se;
u64 count, total;
@@ -474,7 +474,7 @@ static size_t hist_entry__fprintf(struct hist_entry *self,
total = pair_session->events_stats.total;
} else {
count = self->count;
- total = session->events_stats.total;
+ total = session_total;
}
if (total)
@@ -496,8 +496,8 @@ static size_t hist_entry__fprintf(struct hist_entry *self,
if (total > 0)
old_percent = (count * 100.0) / total;
- if (session->events_stats.total > 0)
- new_percent = (self->count * 100.0) / session->events_stats.total;
+ if (session_total > 0)
+ new_percent = (self->count * 100.0) / session_total;
diff = new_percent - old_percent;
@@ -544,16 +544,17 @@ static size_t hist_entry__fprintf(struct hist_entry *self,
left_margin -= thread__comm_len(self->thread);
}
- hist_entry_callchain__fprintf(fp, self, session->events_stats.total,
+ hist_entry_callchain__fprintf(fp, self, session_total,
left_margin);
}
return ret;
}
-size_t perf_session__fprintf_hists(struct perf_session *self,
+size_t perf_session__fprintf_hists(struct rb_root *hists,
struct perf_session *pair,
- bool show_displacement, FILE *fp)
+ bool show_displacement, FILE *fp,
+ u64 session_total)
{
struct sort_entry *se;
struct rb_node *nd;
@@ -641,7 +642,7 @@ size_t perf_session__fprintf_hists(struct perf_session *self,
fprintf(fp, "\n#\n");
print_entries:
- for (nd = rb_first(&self->hists); nd; nd = rb_next(nd)) {
+ for (nd = rb_first(hists); nd; nd = rb_next(nd)) {
struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
if (show_displacement) {
@@ -652,8 +653,8 @@ print_entries:
displacement = 0;
++position;
}
- ret += hist_entry__fprintf(h, self, pair, show_displacement,
- displacement, fp);
+ ret += hist_entry__fprintf(h, pair, show_displacement,
+ displacement, fp, session_total);
}
free(rem_sq_bracket);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 7b48590..16f360c 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -20,9 +20,10 @@ extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *);
extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *);
void hist_entry__free(struct hist_entry *);
-void perf_session__output_resort(struct perf_session *self, u64 total_samples);
-void perf_session__collapse_resort(struct perf_session *self);
-size_t perf_session__fprintf_hists(struct perf_session *self,
+void perf_session__output_resort(struct rb_root *hists, u64 total_samples);
+void perf_session__collapse_resort(struct rb_root *hists);
+size_t perf_session__fprintf_hists(struct rb_root *hists,
struct perf_session *pair,
- bool show_displacement, FILE *fp);
+ bool show_displacement, FILE *fp,
+ u64 session_total);
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home