* Warning from ring buffer code (Was: Re: linux-next: tip tree build warning)
From: Stephen Rothwell @ 2009-09-12 6:53 UTC (permalink / raw)
To: Steven Rostedt
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra,
linux-next, linux-kernel
In-Reply-To: <1249403089.4634.139.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
Hi Steve,
On Tue, 04 Aug 2009 12:24:49 -0400 Steven Rostedt <srostedt@redhat.com> wrote:
>
> On Tue, 2009-08-04 at 16:16 +1000, Stephen Rothwell wrote:
> >
> > Today's linux-next build (powerpc ppc64_defconfig) produced these warnings:
> >
> > kernel/trace/ring_buffer.c: In function 'rb_head_page_set':
> > kernel/trace/ring_buffer.c:704: warning: initialization makes pointer from integer without a cast
> > kernel/trace/ring_buffer.c:704: warning: initialization makes pointer from integer without a cast
> > kernel/trace/ring_buffer.c: In function 'rb_head_page_replace':
> > kernel/trace/ring_buffer.c:797: warning: initialization makes integer from pointer without a cast
> >
> > Introduced by commit 77ae365eca895061c8bf2b2e3ae1d9ea62869739
> > ("ring-buffer: make lockless").
>
> Thanks, I'll take a look at it.
Now that this is in Linus' tree, can we have a fix for the waning, please?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
From: Greg KH @ 2009-09-12 4:33 UTC (permalink / raw)
To: Andrew Vasquez
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
In-Reply-To: <20090912025623.GA14824@plap4-2.local>
On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> On Fri, 11 Sep 2009, Greg KH wrote:
>
> > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > Randy Dunlap noted:
> > >
> > > when CONFIG_MODULES=n:
> > >
> > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > >
> > > in
> > >
> > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > KOBJ_CHANGE, envp);
> > >
> > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> >
> > Um, why? What are you trying to do here? kobject change should not be
> > for a device, or a "normal" kobject.
> >
> > What do you expect userspace to do with this? Where have you documented
> > it?
>
> The purpose was described here:
>
> http://article.gmane.org/gmane.linux.scsi/54155
>
> Basically we'd like to instruct user-space to retrieve a blob of data
> automatically.
Hm, like a firmware object perhaps?
> Original implementation used the kboject hanging off
> the module which does not exist when CONFIG_MODULES=n. It was
> suggested that perhaps an alternative would be to use 'struct device'
> kobj. Any tips on how to trigger such a driver-specific event,
> perhaps a dedicated kobject exported by the driver itself???
Why not use the firmware interface for it, that is what it is designed
for, and you will not have to craft any new udev rules.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
From: James Bottomley @ 2009-09-12 4:06 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
In-Reply-To: <20090912003808.GD12098@plap4-2.local>
On Fri, 2009-09-11 at 17:38 -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
>
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Trigger kobject event on the 'struct device' hanging off the pci_dev.
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>
> > On Fri, 11 Sep 2009, Andrew Vasquez wrote:
> >
> > > The struct device's kobj from pdev->dev?
> > >
> > > My udev-foo is pathetic, so how exactly would that get multiplexed at
> > > the udev side?
> > >
> > > KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
> >
> > Ok, udevadm helps a bit... Let me see if I can convert this uevent
> > off of:
> >
> > kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
> >
> > to something meaningful:
> >
> > UEVENT[1252714722.263731] change
> > /devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
> > ACTION=change
> > DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
> > SUBSYSTEM=pci
> > FW_DUMP=6
> > DRIVER=qla2xxx
> > PHYSDEVBUS=pci
> > PHYSDEVDRIVER=qla2xxx
> > PCI_CLASS=C0400
> > PCI_ID=1077:2532
> > PCI_SUBSYS_ID=1077:015C
> > PCI_SLOT_NAME=0000:1e:00.0
> > MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
> > SEQNUM=3574
>
> Ok, with the kobject_uevent_env() change and the udev-rule modified to:
>
> SUBSYSTEM=="pci", ENV{DRIVER}="qla2xxx", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> we're working again.
>
> This seem reasonable?
>
> Thanks, AV
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..369a270 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> /* do nothing */
> break;
> }
> - kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> - KOBJ_CHANGE, envp);
> + kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
Much better. Of course to be perfect, you might like to remember that
(&x)->y is actually x.y
so
kobject_uevent_env(&vha->hw->pdev->dev.kobj, ...
James
^ permalink raw reply
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
From: Andrew Vasquez @ 2009-09-12 2:56 UTC (permalink / raw)
To: Greg KH
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
In-Reply-To: <20090912005446.GA11691@kroah.com>
On Fri, 11 Sep 2009, Greg KH wrote:
> On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > Randy Dunlap noted:
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> >
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> >
> > Trigger kobject event on the 'struct device' hanging off the pci_dev.
>
> Um, why? What are you trying to do here? kobject change should not be
> for a device, or a "normal" kobject.
>
> What do you expect userspace to do with this? Where have you documented
> it?
The purpose was described here:
http://article.gmane.org/gmane.linux.scsi/54155
Basically we'd like to instruct user-space to retrieve a blob of data
automatically. Original implementation used the kboject hanging off
the module which does not exist when CONFIG_MODULES=n. It was
suggested that perhaps an alternative would be to use 'struct device'
kobj. Any tips on how to trigger such a driver-specific event,
perhaps a dedicated kobject exported by the driver itself???
> confused,
anch'io...
Thanks, AV
^ permalink raw reply
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
From: Greg KH @ 2009-09-12 0:54 UTC (permalink / raw)
To: Andrew Vasquez
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
In-Reply-To: <20090912003808.GD12098@plap4-2.local>
On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
>
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Trigger kobject event on the 'struct device' hanging off the pci_dev.
Um, why? What are you trying to do here? kobject change should not be
for a device, or a "normal" kobject.
What do you expect userspace to do with this? Where have you documented
it?
confused,
greg k-h
^ permalink raw reply
* [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
From: Andrew Vasquez @ 2009-09-12 0:38 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
In-Reply-To: <20090912001752.GC12098@plap4-2.local>
Randy Dunlap noted:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
Trigger kobject event on the 'struct device' hanging off the pci_dev.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
> On Fri, 11 Sep 2009, Andrew Vasquez wrote:
>
> > The struct device's kobj from pdev->dev?
> >
> > My udev-foo is pathetic, so how exactly would that get multiplexed at
> > the udev side?
> >
> > KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> Ok, udevadm helps a bit... Let me see if I can convert this uevent
> off of:
>
> kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
>
> to something meaningful:
>
> UEVENT[1252714722.263731] change
> /devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
> ACTION=change
> DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
> SUBSYSTEM=pci
> FW_DUMP=6
> DRIVER=qla2xxx
> PHYSDEVBUS=pci
> PHYSDEVDRIVER=qla2xxx
> PCI_CLASS=C0400
> PCI_ID=1077:2532
> PCI_SUBSYS_ID=1077:015C
> PCI_SLOT_NAME=0000:1e:00.0
> MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
> SEQNUM=3574
Ok, with the kobject_uevent_env() change and the udev-rule modified to:
SUBSYSTEM=="pci", ENV{DRIVER}="qla2xxx", ACTION=="change", RUN+="qla2xxx_udev.sh"
we're working again.
This seem reasonable?
Thanks, AV
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 29396c0..369a270 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
/* do nothing */
break;
}
- kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
- KOBJ_CHANGE, envp);
+ kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
}
void
^ permalink raw reply related
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
From: Andrew Vasquez @ 2009-09-12 0:17 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
In-Reply-To: <20090912000742.GB12098@plap4-2.local>
On Fri, 11 Sep 2009, Andrew Vasquez wrote:
> The struct device's kobj from pdev->dev?
>
> My udev-foo is pathetic, so how exactly would that get multiplexed at
> the udev side?
>
> KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
Ok, udevadm helps a bit... Let me see if I can convert this uevent
off of:
kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
to something meaningful:
UEVENT[1252714722.263731] change
/devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
ACTION=change
DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
SUBSYSTEM=pci
FW_DUMP=6
DRIVER=qla2xxx
PHYSDEVBUS=pci
PHYSDEVDRIVER=qla2xxx
PCI_CLASS=C0400
PCI_ID=1077:2532
PCI_SUBSYS_ID=1077:015C
PCI_SLOT_NAME=0000:1e:00.0
MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
SEQNUM=3574
Thanks, AV
^ permalink raw reply
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
From: Andrew Vasquez @ 2009-09-12 0:07 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
In-Reply-To: <1252708951.13282.151.camel@mulgrave.site>
On Fri, 11 Sep 2009, James Bottomley wrote:
> On Fri, 2009-09-11 at 10:53 -0700, Andrew Vasquez wrote:
> > Randy Dunlap noted:
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> >
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > ---
> >
> > On Tue, 08 Sep 2009, Andrew Vasquez wrote:
> >
> > > On Mon, 07 Sep 2009, Randy Dunlap wrote:
> > >
> > > > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > Changes since 20090904:
> > > >
> > > >
> > > > when CONFIG_MODULES=n:
> > > >
> > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > >
> > > > in
> > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > KOBJ_CHANGE, envp);
> > >
> > > Argg... Some history here... During several unwelcome
> > > hardware/firmware events (ISP system error, mailbox command timeouts,
> > > etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> > > snapshot of the current state of the ISP firmware). This snapshot is
> > > then captured via a user-space tool querying a driver sysfs-node
> > > hanging off of a scsi_host's device tree:
> > >
> > > /sys/class/scsi_host/host4/device/fw_dump
> > >
> > > The dump is then used by our firmware engineering group to help triage
> > > the issue.
> > >
> > > This recent change:
> > >
> > > commit 10a71b40153a19279428053ad9743e15ef414148
> > > Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > > Date: Tue Aug 25 11:36:15 2009 -0700
> > >
> > > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> > >
> > > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > > Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> > > Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> > >
> > > attempted to help 'automate' the task of retrieval by signaling udev
> > > to automatically run the 'retrieval' script anytime the driver
> > > captured the firmware-dump. Here's a snippet of the udev rule:
> > >
> > > # qla2xxx driver
> > > KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
> > >
> > > Any suggestions here on an alternate driver-specific kobject an LLD
> > > can/should use for something like this? I looked previously at other
> > > callers of kobject_uevent_env(), but didn't really see a simlar
> > > usage-pattern of a driver wanting to signal events to userspace...
> > >
> > > Thanks, AV
> >
> > Ok, So any strong objections to just having the functionality present
> > when module support is enabled?
> >
> > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > index 29396c0..3887adb 100644
> > --- a/drivers/scsi/qla2xxx/qla_os.c
> > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> > static void
> > qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > {
> > +#ifdef CONFIG_MODULES
> > char event_string[40];
> > char *envp[] = { event_string, NULL };
> >
> > @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > }
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> > +#endif
>
> Only emitting events if the thing is compiled as a module doesn't really
> look like the right solution. The first question that springs to mind
> is why are you emitting events against the module kobject in the first
> place? Why not emit them against the device kobject (which is always
> present)?
The struct device's kobj from pdev->dev?
My udev-foo is pathetic, so how exactly would that get multiplexed at
the udev side?
KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
Thanks, AV
^ permalink raw reply
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
From: James Bottomley @ 2009-09-11 22:42 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
In-Reply-To: <20090911175341.GH710@plap4-2.local>
On Fri, 2009-09-11 at 10:53 -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>
> On Tue, 08 Sep 2009, Andrew Vasquez wrote:
>
> > On Mon, 07 Sep 2009, Randy Dunlap wrote:
> >
> > > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> > >
> > > > Hi all,
> > > >
> > > > Changes since 20090904:
> > >
> > >
> > > when CONFIG_MODULES=n:
> > >
> > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > >
> > > in
> > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > KOBJ_CHANGE, envp);
> >
> > Argg... Some history here... During several unwelcome
> > hardware/firmware events (ISP system error, mailbox command timeouts,
> > etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> > snapshot of the current state of the ISP firmware). This snapshot is
> > then captured via a user-space tool querying a driver sysfs-node
> > hanging off of a scsi_host's device tree:
> >
> > /sys/class/scsi_host/host4/device/fw_dump
> >
> > The dump is then used by our firmware engineering group to help triage
> > the issue.
> >
> > This recent change:
> >
> > commit 10a71b40153a19279428053ad9743e15ef414148
> > Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > Date: Tue Aug 25 11:36:15 2009 -0700
> >
> > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> >
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> > Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> >
> > attempted to help 'automate' the task of retrieval by signaling udev
> > to automatically run the 'retrieval' script anytime the driver
> > captured the firmware-dump. Here's a snippet of the udev rule:
> >
> > # qla2xxx driver
> > KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
> >
> > Any suggestions here on an alternate driver-specific kobject an LLD
> > can/should use for something like this? I looked previously at other
> > callers of kobject_uevent_env(), but didn't really see a simlar
> > usage-pattern of a driver wanting to signal events to userspace...
> >
> > Thanks, AV
>
> Ok, So any strong objections to just having the functionality present
> when module support is enabled?
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..3887adb 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> static void
> qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> {
> +#ifdef CONFIG_MODULES
> char event_string[40];
> char *envp[] = { event_string, NULL };
>
> @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> }
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
> +#endif
Only emitting events if the thing is compiled as a module doesn't really
look like the right solution. The first question that springs to mind
is why are you emitting events against the module kobject in the first
place? Why not emit them against the device kobject (which is always
present)?
James
^ permalink raw reply
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
From: Randy Dunlap @ 2009-09-11 21:25 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
In-Reply-To: <20090911175341.GH710@plap4-2.local>
On Fri, 11 Sep 2009 10:53:41 -0700 Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
> Ok, So any strong objections to just having the functionality present
> when module support is enabled?
Fine with me. Thanks.
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..3887adb 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> static void
> qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> {
> +#ifdef CONFIG_MODULES
> char event_string[40];
> char *envp[] = { event_string, NULL };
>
> @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> }
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
> +#endif
> }
>
> void
>
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply
* qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
From: Andrew Vasquez @ 2009-09-11 17:53 UTC (permalink / raw)
To: Linux SCSI Mailing List
Cc: Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali
In-Reply-To: <20090908182541.GB44157@plap4-2.local>
Randy Dunlap noted:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Tue, 08 Sep 2009, Andrew Vasquez wrote:
> On Mon, 07 Sep 2009, Randy Dunlap wrote:
>
> > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> >
> > > Hi all,
> > >
> > > Changes since 20090904:
> >
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
>
> Argg... Some history here... During several unwelcome
> hardware/firmware events (ISP system error, mailbox command timeouts,
> etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> snapshot of the current state of the ISP firmware). This snapshot is
> then captured via a user-space tool querying a driver sysfs-node
> hanging off of a scsi_host's device tree:
>
> /sys/class/scsi_host/host4/device/fw_dump
>
> The dump is then used by our firmware engineering group to help triage
> the issue.
>
> This recent change:
>
> commit 10a71b40153a19279428053ad9743e15ef414148
> Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> Date: Tue Aug 25 11:36:15 2009 -0700
>
> [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
>
> attempted to help 'automate' the task of retrieval by signaling udev
> to automatically run the 'retrieval' script anytime the driver
> captured the firmware-dump. Here's a snippet of the udev rule:
>
> # qla2xxx driver
> KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> Any suggestions here on an alternate driver-specific kobject an LLD
> can/should use for something like this? I looked previously at other
> callers of kobject_uevent_env(), but didn't really see a simlar
> usage-pattern of a driver wanting to signal events to userspace...
>
> Thanks, AV
Ok, So any strong objections to just having the functionality present
when module support is enabled?
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 29396c0..3887adb 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
static void
qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
{
+#ifdef CONFIG_MODULES
char event_string[40];
char *envp[] = { event_string, NULL };
@@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
}
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
+#endif
}
void
^ permalink raw reply related
* Re: drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from 'boolean' to 'tristate'
From: Geert Uytterhoeven @ 2009-09-11 17:22 UTC (permalink / raw)
To: Greg KH; +Cc: Martyn Welch, linux-kernel, Linux-Next
In-Reply-To: <20090911150210.GB16593@kroah.com>
On Fri, Sep 11, 2009 at 17:02, Greg KH<greg@kroah.com> wrote:
> On Fri, Sep 11, 2009 at 04:26:36PM +0200, Geert Uytterhoeven wrote:
>> http://kisskb.ellerman.id.au/kisskb/buildresult/1221192/:
>> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
>> 'boolean' to 'tristate'
>> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
>> 'boolean' to 'tristate'
>>
>> We already have:
>>
>> arch/m68k/Kconfig:config VME
>> arch/m68k/Kconfig: bool "VME (Motorola and BVM) support"
>> arch/m68k/Kconfig: Say Y here if you want to build a kernel for
>> a 680x0 based VME
>
> Ah, not good.
>
> Are these a board-specific thing? It's not the "VME bus" is it?
These are to enable support for the original VME-based machines (VME
started it's life on m68k).
From a historical point of view, it's a bit funny to see the new
CONFIG_VME(_BUS) depends on PCI ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from 'boolean' to 'tristate'
From: Greg KH @ 2009-09-11 16:44 UTC (permalink / raw)
To: Martyn Welch; +Cc: Geert Uytterhoeven, linux-kernel, Linux-Next
In-Reply-To: <4AAA7AEB.803@gefanuc.com>
On Fri, Sep 11, 2009 at 05:29:31PM +0100, Martyn Welch wrote:
> Greg KH wrote:
> > On Fri, Sep 11, 2009 at 04:26:36PM +0200, Geert Uytterhoeven wrote:
> >
> >> http://kisskb.ellerman.id.au/kisskb/buildresult/1221192/:
> >> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
> >> 'boolean' to 'tristate'
> >> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
> >> 'boolean' to 'tristate'
> >>
> >> We already have:
> >>
> >> arch/m68k/Kconfig:config VME
> >> arch/m68k/Kconfig: bool "VME (Motorola and BVM) support"
> >> arch/m68k/Kconfig: Say Y here if you want to build a kernel for
> >> a 680x0 based VME
> >>
> >
> > Ah, not good.
> >
> > Are these a board-specific thing? It's not the "VME bus" is it?
> >
> > Martyn, maybe we should rename CONFIG_VME to CONFIG_VME_BUS ?
> >
> > thanks,
> >
> > greg k-h
> >
> Agreed - Not good.
>
> I'll try and rustle up a patch ASAP, but it might not be until Monday
> now - I unfortunately have a rather busy weekend. I'm more than happy
> with CONFIG_VME_BUS if someone beats me to it.
I'll go do it right now.
thanks,
greg k-h
^ permalink raw reply
* Re: drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from 'boolean' to 'tristate'
From: Martyn Welch @ 2009-09-11 16:29 UTC (permalink / raw)
To: Greg KH; +Cc: Geert Uytterhoeven, linux-kernel, Linux-Next
In-Reply-To: <20090911150210.GB16593@kroah.com>
Greg KH wrote:
> On Fri, Sep 11, 2009 at 04:26:36PM +0200, Geert Uytterhoeven wrote:
>
>> http://kisskb.ellerman.id.au/kisskb/buildresult/1221192/:
>> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
>> 'boolean' to 'tristate'
>> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
>> 'boolean' to 'tristate'
>>
>> We already have:
>>
>> arch/m68k/Kconfig:config VME
>> arch/m68k/Kconfig: bool "VME (Motorola and BVM) support"
>> arch/m68k/Kconfig: Say Y here if you want to build a kernel for
>> a 680x0 based VME
>>
>
> Ah, not good.
>
> Are these a board-specific thing? It's not the "VME bus" is it?
>
> Martyn, maybe we should rename CONFIG_VME to CONFIG_VME_BUS ?
>
> thanks,
>
> greg k-h
>
Agreed - Not good.
I'll try and rustle up a patch ASAP, but it might not be until Monday
now - I unfortunately have a rather busy weekend. I'm more than happy
with CONFIG_VME_BUS if someone beats me to it.
Martyn
--
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales
Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 927559189
^ permalink raw reply
* Re: drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from 'boolean' to 'tristate'
From: Greg KH @ 2009-09-11 15:02 UTC (permalink / raw)
To: Geert Uytterhoeven, Martyn Welch; +Cc: linux-kernel, Linux-Next
In-Reply-To: <10f740e80909110726x313e3e3coe2321c683163e3a5@mail.gmail.com>
On Fri, Sep 11, 2009 at 04:26:36PM +0200, Geert Uytterhoeven wrote:
> http://kisskb.ellerman.id.au/kisskb/buildresult/1221192/:
> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
> 'boolean' to 'tristate'
> drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
> 'boolean' to 'tristate'
>
> We already have:
>
> arch/m68k/Kconfig:config VME
> arch/m68k/Kconfig: bool "VME (Motorola and BVM) support"
> arch/m68k/Kconfig: Say Y here if you want to build a kernel for
> a 680x0 based VME
Ah, not good.
Are these a board-specific thing? It's not the "VME bus" is it?
Martyn, maybe we should rename CONFIG_VME to CONFIG_VME_BUS ?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 0/3] kernel.h: move logging functions to separate file
From: Steven Rostedt @ 2009-09-11 14:55 UTC (permalink / raw)
To: Joe Perches
Cc: linux-kernel, linux-next, Ingo Molnar, Greg Kroah-Hartman,
Andrew Morton, Peter Zijlstra
In-Reply-To: <cover.1252639195.git.joe@perches.com>
On Thu, 2009-09-10 at 20:29 -0700, Joe Perches wrote:
> kernel.h has gotten cluttered.
> Unclutter it and make it kernel style compatible.
>
> Joe Perches (3):
> include/linux/logging.h: Separate logging functions out of kernel.h
> include/linux/logging.h: Reduce data usage of printk_once
> include/linux/kernel.h: neaten and group functions and definitions
>
> include/linux/kernel.h | 754 ++++++++++++++++-------------------------------
> include/linux/logging.h | 313 ++++++++++++++++++++
> 2 files changed, 573 insertions(+), 494 deletions(-)
> create mode 100644 include/linux/logging.h
>
This is just clean up code, so I'm fine with it.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply
* drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from 'boolean' to 'tristate'
From: Geert Uytterhoeven @ 2009-09-11 14:26 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Linux-Next
http://kisskb.ellerman.id.au/kisskb/buildresult/1221192/:
drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
'boolean' to 'tristate'
drivers/staging/vme/Kconfig:5:warning: type of 'VME' redefined from
'boolean' to 'tristate'
We already have:
arch/m68k/Kconfig:config VME
arch/m68k/Kconfig: bool "VME (Motorola and BVM) support"
arch/m68k/Kconfig: Say Y here if you want to build a kernel for
a 680x0 based VME
arch/m68k/Kconfig: depends on VME
arch/m68k/Kconfig: Say Y to include support for early Motorola
VME boards. This will
arch/m68k/Kconfig: depends on VME
arch/m68k/Kconfig: Say Y to include support for Motorola VME
boards. This will build a
arch/m68k/Kconfig: depends on VME
arch/m68k/Kconfig: Say Y to include support for VME boards from
BVM Ltd. This will
arch/m68k/Kconfig: depends on (AMIGA || ATARI || MAC || SUN3 ||
SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || AT
fs/partitions/Kconfig: default y if VME
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* linux-next: Tree for September 11
From: Stephen Rothwell @ 2009-09-11 9:15 UTC (permalink / raw)
To: linux-next; +Cc: LKML
[-- Attachment #1: Type: text/plain, Size: 9556 bytes --]
Hi all,
Please do not add code destined for 2.6.33 into linux-next trees until
(at least) 2.6.32-rc1 is out. This will hopefully give those who have
stuff destined for just after -rc1 a chance.
Changes since 20090910:
The rr tree still has a build failure so I used the version from
next-20090908.
The block tree gained a build failure so I used the version from
next-20090910.
The scsi-post-merge tree lost its build failure.
----------------------------------------------------------------------------
I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ). If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one. You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).
You can see which trees have been included by looking in the Next/Trees
file in the source. There are also quilt-import.log and merge.log files
in the Next directory. Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.
Below is a summary of the state of the merge.
We are up to 140 trees (counting Linus' and 21 trees of patches pending for
Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.
Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next . If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.
Thanks to Jan Dittmer for adding the linux-next tree to his build tests
at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
Dunlap for doing many randconfig builds.
There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ . Thanks to Frank Seidel.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/master
Merging quilt/driver-core.current
Merging quilt/tty.current
Merging quilt/usb.current
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging arm/devel
Merging davinci/for-next
Merging pxa/for-next
Merging thumb-2/thumb-2
CONFLICT (add/add): Merge conflict in arch/arm/include/asm/unified.h
Merging avr32/avr32-arch
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging microblaze/next
Merging mips/mips-for-linux-next
Merging parisc/next
Merging powerpc/next
CONFLICT (content): Merge conflict in kernel/gcov/Kconfig
Merging 4xx/next
Merging galak/next
Merging s390/features
Merging sh/master
Merging sparc/master
CONFLICT (content): Merge conflict in arch/sparc/Kconfig
Merging xtensa/master
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
Merging ext4/next
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging jfs/next
Merging nfs/linux-next
Merging nfsd/nfsd-next
CONFLICT (content): Merge conflict in net/sunrpc/cache.c
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
Merging ubifs/linux-next
Merging xfs/master
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_lrw.c
Merging reiserfs-bkl/reiserfs/kill-bkl
Merging vfs/for-next
Merging pci/linux-next
CONFLICT (content): Merge conflict in arch/powerpc/kernel/pci_64.c
Applying: pci: merge fixup for fundamental reset conflict with powerpc tree
Merging hid/for-next
Merging quilt/i2c
Merging quilt/jdelvare-hwmon
Merging quilt/kernel-doc
Merging v4l-dvb/master
CONFLICT (content): Merge conflict in drivers/media/video/sh_mobile_ceu_camera.c
Merging quota/for_next
Merging kbuild/master
Merging kconfig/for-next
CONFLICT (content): Merge conflict in scripts/extract-ikconfig
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
CONFLICT (content): Merge conflict in drivers/acpi/power.c
Merging ieee1394/for-next
Merging ubi/linux-next
Merging kvm/linux-next
Merging dlm/next
Merging scsi/master
Merging async_tx/next
Merging net/master
Merging wireless/master
Merging mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
Merging crypto/master
Merging sound/for-next
Merging cpufreq/next
Merging quilt/rr
$ git reset --hard HEAD^
Merging refs/next/20090908/rr
CONFLICT (content): Merge conflict in drivers/net/virtio_net.c
Merging mmc/next
Merging input/next
CONFLICT (content): Merge conflict in drivers/base/platform.c
Merging lsm/for-next
Merging block/for-next
CONFLICT (content): Merge conflict in fs/ubifs/super.c
$ git reset --hard HEAD^
Merging refs/next/20090910/block
CONFLICT (content): Merge conflict in drivers/block/aoe/aoeblk.c
CONFLICT (content): Merge conflict in fs/ubifs/super.c
Merging quilt/device-mapper
CONFLICT (content): Merge conflict in drivers/block/aoe/aoeblk.c
CONFLICT (content): Merge conflict in fs/fs-writeback.c
CONFLICT (content): Merge conflict in fs/ubifs/super.c
CONFLICT (content): Merge conflict in mm/backing-dev.c
$ git reset --hard HEAD^
Merging refs/next/20090910/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
Merging battery/master
CONFLICT (content): Merge conflict in drivers/power/wm97xx_battery.c
Merging leds/for-mm
Merging backlight/for-mm
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
CONFLICT (content): Merge conflict in drivers/input/misc/Kconfig
Merging hdlc/hdlc-next
Merging drm/drm-next
CONFLICT (content): Merge conflict in firmware/Makefile
Merging voltage/for-next
CONFLICT (content): Merge conflict in drivers/regulator/Kconfig
Merging security-testing/next
CONFLICT (content): Merge conflict in arch/arm/kernel/signal.c
CONFLICT (content): Merge conflict in arch/parisc/include/asm/thread_info.h
CONFLICT (content): Merge conflict in arch/parisc/kernel/entry.S
CONFLICT (content): Merge conflict in arch/parisc/kernel/signal.c
Applying: security: fix merge for tun_struct changes
Merging lblnet/master
CONFLICT (content): Merge conflict in drivers/net/tun.c
Merging agp/agp-next
CONFLICT (content): Merge conflict in drivers/char/agp/uninorth-agp.c
Merging uwb/for-upstream
Merging watchdog/master
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
Merging audit/for-next
Merging omap/for-next
Merging quilt/aoe
Merging suspend/linux-next
Merging bluetooth/master
Merging fsnotify/for-next
Merging irda/for-next
Merging hwlat/for-linus
Merging drbd/drbd
Merging kmemleak/kmemleak
Merging tip/auto-latest
CONFLICT (content): Merge conflict in arch/x86/include/asm/socket.h
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
CONFLICT (content): Merge conflict in drivers/pci/dmar.c
CONFLICT (content): Merge conflict in drivers/pci/intel-iommu.c
CONFLICT (content): Merge conflict in include/linux/rcupdate.h
Applying: tip: fix merge for cupmask update
Merging oprofile/for-next
CONFLICT (content): Merge conflict in kernel/trace/ring_buffer.c
Merging percpu/for-next
CONFLICT (content): Merge conflict in arch/sh/kernel/vmlinux.lds.S
CONFLICT (content): Merge conflict in kernel/sched.c
CONFLICT (content): Merge conflict in mm/percpu.c
Merging sfi/sfi-test
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
Merging asm-generic/next
Merging hwpoison/hwpoison
Merging quilt/driver-core
CONFLICT (content): Merge conflict in drivers/base/class.c
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
CONFLICT (content): Merge conflict in init/main.c
Merging quilt/tty
CONFLICT (content): Merge conflict in arch/x86/include/asm/termios.h
Merging quilt/usb
Merging quilt/staging
CONFLICT (delete/modify): drivers/staging/at76_usb/at76_usb.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/at76_usb/at76_usb.c left in tree.
CONFLICT (delete/modify): drivers/staging/epl/VirtualEthernetLinux.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/epl/VirtualEthernetLinux.c left in tree.
$ git rm -f drivers/staging/epl/VirtualEthernetLinux.c
$ git rm -f drivers/staging/at76_usb/at76_usb.c
Merging scsi-post-merge/master
CONFLICT (content): Merge conflict in drivers/scsi/Makefile
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* linux-next: tip tree build warning
From: Stephen Rothwell @ 2009-09-11 8:56 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
Hi all,
Today's linux-next build (powerpc allnoconfig) produced this warning:
kernel/sched.c:122: warning: 'double_rq_lock' declared 'static' but never defined
Introduced by commit 18a3885fc1ffa92c2212ff0afdf033403d5b0fa0 ("sched:
Remove reciprocal for cpu_power"). This is a build with CONFIG_SMP
undefined.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* linux-next: drm tree build warning
From: Stephen Rothwell @ 2009-09-11 8:08 UTC (permalink / raw)
To: Dave Airlie; +Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
Hi Dave,
Today's linux-next build (x86_64 allmodconfig) produced this warning:
drivers/gpu/drm/radeon/r100.c: In function 'r100_cs_parse':
drivers/gpu/drm/radeon/r100.c:1623: warning: the frame size of 3120 bytes is larger than 2048 bytes
drivers/gpu/drm/radeon/r300.c: In function 'r300_cs_parse':
drivers/gpu/drm/radeon/r300.c:1270: warning: the frame size of 3104 bytes is larger than 2048 bytes
Probably caused by commit 551ebd837c75fc75df81811a18b7136c39cab487
("drm/radeon/kms: add rn50/r100/r200 CS tracker") which added a very
large structure to the stack of each of these functions.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: linux-next: block tree build failure
From: Jens Axboe @ 2009-09-11 5:30 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel
In-Reply-To: <20090911143203.e52e294d.sfr@canb.auug.org.au>
On Fri, Sep 11 2009, Stephen Rothwell wrote:
> Hi Jens,
>
> Today's linux-next build (x86_64 allmodconfig) failed like this:
>
> drivers/block/aoe/aoeblk.c: In function 'aoeblk_gdalloc':
> drivers/block/aoe/aoeblk.c:271: error: request for member 'backing_dev_info' in something not a structure or union
>
> Caused by commit 7cd6134162529e6b7f9eaa5d72b1ef8fe3b355c9 ("writeback:
> add name to backing_dev_info"). 'q->blkq' changed to be a pointer in
> commit 7135a71b19be1faf48b7148d77844d03bc0717d6 ("aoe: allocate unused
> request_queue for sysfs").
>
> Please be a bit more careful with rebases.
Sorry, I thought I had double checked it... Will fix it now.
> I have used the version of the block tree from next-20090910 for today.
No problem.
--
Jens Axboe
^ permalink raw reply
* linux-next: block tree build failure
From: Stephen Rothwell @ 2009-09-11 4:32 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
Hi Jens,
Today's linux-next build (x86_64 allmodconfig) failed like this:
drivers/block/aoe/aoeblk.c: In function 'aoeblk_gdalloc':
drivers/block/aoe/aoeblk.c:271: error: request for member 'backing_dev_info' in something not a structure or union
Caused by commit 7cd6134162529e6b7f9eaa5d72b1ef8fe3b355c9 ("writeback:
add name to backing_dev_info"). 'q->blkq' changed to be a pointer in
commit 7135a71b19be1faf48b7148d77844d03bc0717d6 ("aoe: allocate unused
request_queue for sysfs").
Please be a bit more careful with rebases.
I have used the version of the block tree from next-20090910 for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [PATCH 3/3] include/linux/kernel.h: neaten and group functions and definitions
From: Joe Perches @ 2009-09-11 3:29 UTC (permalink / raw)
To: linux-kernel, linux-next
Cc: Ingo Molnar, Greg Kroah-Hartman, Andrew Morton, Steven Rostedt,
Peter Zijlstra
In-Reply-To: <cover.1252639195.git.joe@perches.com>
Reduce the clutter, make checkpatch cleaner.
There are a couple of checkpatch false positives.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/kernel.h | 467 +++++++++++++++++++++++++++---------------------
1 files changed, 262 insertions(+), 205 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 20eb8ae..6fe9ac6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -21,6 +21,9 @@
#include <asm/byteorder.h>
#include <asm/bug.h>
+/*
+ * tracing structs, functions and redefined "if"
+ */
struct ftrace_branch_data {
const char *func;
const char *file;
@@ -112,82 +115,57 @@ static inline void branch_profiler(struct ftrace_branch_data *data, int cond)
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#endif
+/*
+ * little limits
+ */
#define USHORT_MAX ((u16)(~0U))
-#define SHORT_MAX ((s16)(USHORT_MAX>>1))
+#define SHORT_MAX ((s16)(USHORT_MAX >> 1))
#define SHORT_MIN (-SHORT_MAX - 1)
-#define INT_MAX ((int)(~0U>>1))
+#define INT_MAX ((int)(~0U >> 1))
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (~0U)
-#define LONG_MAX ((long)(~0UL>>1))
+#define LONG_MAX ((long)(~0UL >> 1))
#define LONG_MIN (-LONG_MAX - 1)
#define ULONG_MAX (~0UL)
-#define LLONG_MAX ((long long)(~0ULL>>1))
+#define LLONG_MAX ((long long)(~0ULL >> 1))
#define LLONG_MIN (-LLONG_MAX - 1)
#define ULLONG_MAX (~0ULL)
-#define STACK_MAGIC 0xdeadbeef
-
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
-#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
-#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
+/*
+ * Alignment checks
+ */
+#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1)
+#define PTR_ALIGN(p, a) ((typeof(p))ALIGN(((unsigned long)(p)), (a)))
+#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
+/*
+ * Simple array sizes and offsets
+ */
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f))
-#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
-#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
-#define DIV_ROUND_CLOSEST(x, divisor)( \
-{ \
- typeof(divisor) __divisor = divisor; \
- (((x) + ((__divisor) / 2)) / (__divisor)); \
-} \
-)
-
-#define _RET_IP_ (unsigned long)__builtin_return_address(0)
-#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
-
-#ifdef CONFIG_LBDAF
-# include <asm/div64.h>
-# define sector_div(a, b) do_div(a, b)
-#else
-# define sector_div(n, b)( \
-{ \
- int _res; \
- _res = (n) % (b); \
- (n) /= (b); \
- _res; \
-} \
-)
-#endif
+/*
+ * swap - swap value of @a and @b
+ */
+#define swap(a, b) \
+ do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
/**
- * upper_32_bits - return bits 32-63 of a number
- * @n: the number we're accessing
+ * container_of - cast a member of a structure out to the containing structure
+ * @ptr: the pointer to the member.
+ * @type: the type of the container struct this is embedded in.
+ * @member: the name of the member within the struct.
*
- * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
- * the "right shift count >= width of type" warning when that quantity is
- * 32-bits.
*/
-#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+#define container_of(ptr, type, member) \
+({ const typeof(((type *)0)->member) *__mptr = (ptr); \
+ (type *)((char *)__mptr - offsetof(type, member)); \
+})
-/**
- * lower_32_bits - return bits 0-31 of a number
- * @n: the number we're accessing
+/*
+ * sleep/reschedule/fault checks
*/
-#define lower_32_bits(n) ((u32)(n))
-
-struct completion;
-struct pt_regs;
-struct user;
-
-#ifdef CONFIG_PREEMPT_VOLUNTARY
-extern int _cond_resched(void);
-# define might_resched() _cond_resched()
-#else
-# define might_resched() do { } while (0)
-#endif
-
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
void __might_sleep(char *file, int line, int preempt_offset);
/**
@@ -209,10 +187,12 @@ extern int _cond_resched(void);
#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
-#define abs(x) ({ \
- int __x = (x); \
- (__x < 0) ? -__x : __x; \
- })
+#ifdef CONFIG_PREEMPT_VOLUNTARY
+extern int _cond_resched(void);
+# define might_resched() _cond_resched()
+#else
+# define might_resched() do { } while (0)
+#endif
#ifdef CONFIG_PROVE_LOCKING
void might_fault(void);
@@ -223,34 +203,206 @@ static inline void might_fault(void)
}
#endif
+/*
+ * Miscellaneous math functions
+ */
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define DIV_ROUND_CLOSEST(x, divisor) \
+({ typeof(divisor) __divisor = divisor; \
+ (((x) + ((__divisor) / 2)) / (__divisor)); \
+})
+
+#define abs(x) \
+({ int __x = (x); \
+ (__x < 0) ? -__x : __x; \
+})
+
+/*
+ * min()/max()/clamp() macros that also do
+ * strict type-checking.. See the
+ * "unnecessary" pointer comparison.
+ */
+#define min(x, y) \
+({ typeof(x) _min1 = (x); \
+ typeof(y) _min2 = (y); \
+ (void)(&_min1 == &_min2); \
+ _min1 < _min2 ? _min1 : _min2; \
+})
+
+#define max(x, y) \
+({ typeof(x) _max1 = (x); \
+ typeof(y) _max2 = (y); \
+ (void)(&_max1 == &_max2); \
+ _max1 > _max2 ? _max1 : _max2; \
+})
+
+/**
+ * clamp - return a value clamped to a given range with strict typechecking
+ * @val: current value
+ * @min: minimum allowable value
+ * @max: maximum allowable value
+ *
+ * This macro does strict typechecking of min/max to make sure they are of the
+ * same type as val. See the unnecessary pointer comparisons.
+ */
+#define clamp(val, min, max) \
+({ typeof(val) __val = (val); \
+ typeof(min) __min = (min); \
+ typeof(max) __max = (max); \
+ (void)(&__val == &__min); \
+ (void)(&__val == &__max); \
+ __val = __val < __min ? __min : __val; \
+ __val > __max ? __max : __val; \
+})
+
+/*
+ * ..and if you can't take the strict
+ * types, you can specify one yourself.
+ *
+ * Or not use min/max/clamp at all, of course.
+ */
+#define min_t(type, x, y) \
+({ type __min1 = (x); \
+ type __min2 = (y); \
+ __min1 < __min2 ? __min1 : __min2; \
+})
+
+#define max_t(type, x, y) \
+({ type __max1 = (x); \
+ type __max2 = (y); \
+ __max1 > __max2 ? __max1 : __max2; \
+})
+
+/**
+ * clamp_t - return a value clamped to a given range using a given type
+ * @type: the type of variable to use
+ * @val: current value
+ * @min: minimum allowable value
+ * @max: maximum allowable value
+ *
+ * This macro does no typechecking and uses temporary variables of type
+ * 'type' to make all the comparisons.
+ */
+#define clamp_t(type, val, min, max) \
+({ type __val = (val); \
+ type __min = (min); \
+ type __max = (max); \
+ __val = __val < __min ? __min : __val; \
+ __val > __max ? __max : __val; \
+})
+
+/**
+ * clamp_val - return a value clamped to a given range using val's type
+ * @val: current value
+ * @min: minimum allowable value
+ * @max: maximum allowable value
+ *
+ * This macro does no typechecking and uses temporary variables of whatever
+ * type the input argument 'val' is. This is useful when val is an unsigned
+ * type and min and max are literals that will otherwise be assigned a signed
+ * integer type.
+ */
+#define clamp_val(val, min, max) \
+({ typeof(val) __val = (val); \
+ typeof(val) __min = (min); \
+ typeof(val) __max = (max); \
+ __val = __val < __min ? __min : __val; \
+ __val > __max ? __max : __val; \
+})
+
+unsigned long int_sqrt(unsigned long);
+
+#ifdef CONFIG_LBDAF
+# include <asm/div64.h>
+# define sector_div(a, b) do_div(a, b)
+#else
+# define sector_div(n, b) \
+({ int _res; \
+ _res = (n) % (b); \
+ (n) /= (b); \
+ _res; \
+})
+#endif
+
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
+ * the "right shift count >= width of type" warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
+/*
+ * Panic/oops/exit functions and data
+ */
+struct completion;
+struct pt_regs;
+struct user;
+
extern struct atomic_notifier_head panic_notifier_list;
extern long (*panic_blink)(long time);
-NORET_TYPE void panic(const char * fmt, ...)
- __attribute__ ((NORET_AND format (printf, 1, 2))) __cold;
+void panic(const char *fmt, ...)
+ __attribute__ ((noreturn, format (printf, 1, 2))) __cold;
extern void oops_enter(void);
extern void oops_exit(void);
extern int oops_may_print(void);
-NORET_TYPE void do_exit(long error_code)
- ATTRIB_NORET;
-NORET_TYPE void complete_and_exit(struct completion *, long)
- ATTRIB_NORET;
-extern unsigned long simple_strtoul(const char *,char **,unsigned int);
-extern long simple_strtol(const char *,char **,unsigned int);
-extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
-extern long long simple_strtoll(const char *,char **,unsigned int);
-extern int strict_strtoul(const char *, unsigned int, unsigned long *);
-extern int strict_strtol(const char *, unsigned int, long *);
-extern int strict_strtoull(const char *, unsigned int, unsigned long long *);
-extern int strict_strtoll(const char *, unsigned int, long long *);
-extern int sprintf(char * buf, const char * fmt, ...)
+void do_exit(long error_code) __attribute__ ((noreturn));
+void complete_and_exit(struct completion *comp, long code)
+ __attribute__ ((noreturn));
+extern void bust_spinlocks(int yes);
+extern void wake_up_klogd(void);
+extern int oops_in_progress; /* If set, one of these is in progress:
+ * oops, panic(), BUG() or die() */
+extern int panic_timeout;
+extern int panic_on_oops;
+extern int panic_on_unrecovered_nmi;
+extern int panic_on_io_nmi;
+
+/*
+ * string to value functions
+ */
+extern int strict_strtoul(const char *cp, unsigned int base,
+ unsigned long *res);
+extern int strict_strtol(const char *cp, unsigned int base,
+ long *res);
+extern int strict_strtoull(const char *cp, unsigned int base,
+ unsigned long long *res);
+extern int strict_strtoll(const char *cp, unsigned int base,
+ long long *res);
+
+/*
+ * deprecated string to value functions, use strict_ variants instead
+ */
+extern unsigned long simple_strtoul(const char *cp, char **endp,
+ unsigned int base);
+extern long simple_strtol(const char *cp, char **endp,
+ unsigned int base);
+extern unsigned long long simple_strtoull(const char *cp, char **endp,
+ unsigned int base);
+extern long long simple_strtoll(const char *cp, char **endp,
+ unsigned int base);
+
+/*
+ * printf functions
+ */
+extern int sprintf(char *buf, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
extern int vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
-extern int snprintf(char * buf, size_t size, const char * fmt, ...)
+extern int snprintf(char *buf, size_t size, const char *fmt, ...)
__attribute__ ((format (printf, 3, 4)));
extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
__attribute__ ((format (printf, 3, 0)));
-extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
+extern int scnprintf(char *buf, size_t size, const char *fmt, ...)
__attribute__ ((format (printf, 3, 4)));
extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
__attribute__ ((format (printf, 3, 0)));
@@ -258,38 +410,34 @@ extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
+/*
+ * scanf functions
+ */
extern int sscanf(const char *, const char *, ...)
__attribute__ ((format (scanf, 2, 3)));
extern int vsscanf(const char *, const char *, va_list)
__attribute__ ((format (scanf, 2, 0)));
+/*
+ * command line options functions
+ */
extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints);
extern unsigned long long memparse(const char *ptr, char **retptr);
+/*
+ * kernel addressing info
+ */
extern int core_kernel_text(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);
+#define _RET_IP_ (unsigned long)__builtin_return_address(0)
+#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
-struct pid;
-extern struct pid *session_of_pgrp(struct pid *pgrp);
-
-unsigned long int_sqrt(unsigned long);
-
-extern void bust_spinlocks(int yes);
-extern void wake_up_klogd(void);
-extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
-extern int panic_timeout;
-extern int panic_on_oops;
-extern int panic_on_unrecovered_nmi;
-extern int panic_on_io_nmi;
-extern void add_taint(unsigned flag);
-extern int test_taint(unsigned flag);
-extern unsigned long get_taint(void);
-extern int root_mountflags;
-
-/* Values used for system_state */
+/*
+ *Values used for system_state
+ */
extern enum system_states {
SYSTEM_BOOTING,
SYSTEM_RUNNING,
@@ -299,6 +447,13 @@ extern enum system_states {
SYSTEM_SUSPEND_DISK,
} system_state;
+/*
+ * Kernel taint functions (non-gpl modules, etc)
+ */
+extern void add_taint(unsigned flag);
+extern int test_taint(unsigned flag);
+extern unsigned long get_taint(void);
+
#define TAINT_PROPRIETARY_MODULE 0
#define TAINT_FORCED_MODULE 1
#define TAINT_UNSAFE_SMP 2
@@ -319,13 +474,13 @@ enum {
DUMP_PREFIX_OFFSET
};
extern void hex_dump_to_buffer(const void *buf, size_t len,
- int rowsize, int groupsize,
- char *linebuf, size_t linebuflen, bool ascii);
+ int rowsize, int groupsize,
+ char *linebuf, size_t linebuflen, bool ascii);
extern void print_hex_dump(const char *level, const char *prefix_str,
- int prefix_type, int rowsize, int groupsize,
- const void *buf, size_t len, bool ascii);
+ int prefix_type, int rowsize, int groupsize,
+ const void *buf, size_t len, bool ascii);
extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
- const void *buf, size_t len);
+ const void *buf, size_t len);
extern const char hex_asc[];
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
@@ -341,7 +496,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
/*
* Display an IP address in readable format.
*/
-
#define NIPQUAD(addr) \
((unsigned char *)&addr)[0], \
((unsigned char *)&addr)[1], \
@@ -350,109 +504,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
#define NIPQUAD_FMT "%u.%u.%u.%u"
/*
- * min()/max()/clamp() macros that also do
- * strict type-checking.. See the
- * "unnecessary" pointer comparison.
- */
-#define min(x, y) ({ \
- typeof(x) _min1 = (x); \
- typeof(y) _min2 = (y); \
- (void) (&_min1 == &_min2); \
- _min1 < _min2 ? _min1 : _min2; })
-
-#define max(x, y) ({ \
- typeof(x) _max1 = (x); \
- typeof(y) _max2 = (y); \
- (void) (&_max1 == &_max2); \
- _max1 > _max2 ? _max1 : _max2; })
-
-/**
- * clamp - return a value clamped to a given range with strict typechecking
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does strict typechecking of min/max to make sure they are of the
- * same type as val. See the unnecessary pointer comparisons.
- */
-#define clamp(val, min, max) ({ \
- typeof(val) __val = (val); \
- typeof(min) __min = (min); \
- typeof(max) __max = (max); \
- (void) (&__val == &__min); \
- (void) (&__val == &__max); \
- __val = __val < __min ? __min: __val; \
- __val > __max ? __max: __val; })
-
-/*
- * ..and if you can't take the strict
- * types, you can specify one yourself.
- *
- * Or not use min/max/clamp at all, of course.
+ * unclassified or really miscellaneous
*/
-#define min_t(type, x, y) ({ \
- type __min1 = (x); \
- type __min2 = (y); \
- __min1 < __min2 ? __min1: __min2; })
-
-#define max_t(type, x, y) ({ \
- type __max1 = (x); \
- type __max2 = (y); \
- __max1 > __max2 ? __max1: __max2; })
-
-/**
- * clamp_t - return a value clamped to a given range using a given type
- * @type: the type of variable to use
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does no typechecking and uses temporary variables of type
- * 'type' to make all the comparisons.
- */
-#define clamp_t(type, val, min, max) ({ \
- type __val = (val); \
- type __min = (min); \
- type __max = (max); \
- __val = __val < __min ? __min: __val; \
- __val > __max ? __max: __val; })
-
-/**
- * clamp_val - return a value clamped to a given range using val's type
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does no typechecking and uses temporary variables of whatever
- * type the input argument 'val' is. This is useful when val is an unsigned
- * type and min and max are literals that will otherwise be assigned a signed
- * integer type.
- */
-#define clamp_val(val, min, max) ({ \
- typeof(val) __val = (val); \
- typeof(val) __min = (min); \
- typeof(val) __max = (max); \
- __val = __val < __min ? __min: __val; \
- __val > __max ? __max: __val; })
-
-
-/*
- * swap - swap value of @a and @b
- */
-#define swap(a, b) \
- do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
-
-/**
- * container_of - cast a member of a structure out to the containing structure
- * @ptr: the pointer to the member.
- * @type: the type of the container struct this is embedded in.
- * @member: the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
+#define STACK_MAGIC 0xdeadbeef
+extern int root_mountflags;
+struct pid;
+extern struct pid *session_of_pgrp(struct pid *pgrp);
struct sysinfo;
extern int do_sysinfo(struct sysinfo *info);
--
1.6.3.1.10.g659a0.dirty
^ permalink raw reply related
* [PATCH 2/3] include/linux/logging.h: Reduce data usage of printk_once
From: Joe Perches @ 2009-09-11 3:29 UTC (permalink / raw)
To: linux-kernel, linux-next
Cc: Ingo Molnar, Greg Kroah-Hartman, Andrew Morton, Steven Rostedt,
Peter Zijlstra
In-Reply-To: <cover.1252639195.git.joe@perches.com>
Use bool for int
Don't initialize __printk_once, invert test
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/logging.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/logging.h b/include/linux/logging.h
index 361d5ed..d76ccfa 100644
--- a/include/linux/logging.h
+++ b/include/linux/logging.h
@@ -91,10 +91,10 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
*/
#define printk_once(fmt, ...) \
({ \
- static int __print_once = 1; \
+ static bool __print_once; \
\
- if (__print_once) { \
- __print_once = 0; \
+ if (!__print_once) { \
+ __print_once = true; \
printk(fmt, ##__VA_ARGS__); \
} \
})
--
1.6.3.1.10.g659a0.dirty
^ permalink raw reply related
* [PATCH 1/3] include/linux/logging.h: Separate logging functions out of kernel.h
From: Joe Perches @ 2009-09-11 3:29 UTC (permalink / raw)
To: linux-kernel, linux-next
Cc: Ingo Molnar, Greg Kroah-Hartman, Andrew Morton, Steven Rostedt,
Peter Zijlstra
In-Reply-To: <cover.1252639195.git.joe@perches.com>
Moved all logging/tracing bits to a separate file
Neatened a bit for checkpatch complaints
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/kernel.h | 293 +-------------------------------------------
include/linux/logging.h | 313 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 314 insertions(+), 292 deletions(-)
create mode 100644 include/linux/logging.h
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f61039e..20eb8ae 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -17,10 +17,10 @@
#include <linux/typecheck.h>
#include <linux/ratelimit.h>
#include <linux/dynamic_debug.h>
+#include <linux/logging.h>
#include <asm/byteorder.h>
#include <asm/bug.h>
-
struct ftrace_branch_data {
const char *func;
const char *file;
@@ -112,9 +112,6 @@ static inline void branch_profiler(struct ftrace_branch_data *data, int cond)
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#endif
-extern const char linux_banner[];
-extern const char linux_proc_banner[];
-
#define USHORT_MAX ((u16)(~0U))
#define SHORT_MAX ((s16)(USHORT_MAX>>1))
#define SHORT_MIN (-SHORT_MAX - 1)
@@ -180,31 +177,6 @@ extern const char linux_proc_banner[];
*/
#define lower_32_bits(n) ((u32)(n))
-#define KERN_EMERG "<0>" /* system is unusable */
-#define KERN_ALERT "<1>" /* action must be taken immediately */
-#define KERN_CRIT "<2>" /* critical conditions */
-#define KERN_ERR "<3>" /* error conditions */
-#define KERN_WARNING "<4>" /* warning conditions */
-#define KERN_NOTICE "<5>" /* normal but significant condition */
-#define KERN_INFO "<6>" /* informational */
-#define KERN_DEBUG "<7>" /* debug-level messages */
-
-/* Use the default kernel loglevel */
-#define KERN_DEFAULT "<d>"
-/*
- * Annotation for a "continued" line of log printout (only done after a
- * line that had no enclosing \n). Only to be used by core/arch code
- * during early bootup (a continued line is not SMP-safe otherwise).
- */
-#define KERN_CONT "<c>"
-
-extern int console_printk[];
-
-#define console_loglevel (console_printk[0])
-#define default_message_loglevel (console_printk[1])
-#define minimum_console_loglevel (console_printk[2])
-#define default_console_loglevel (console_printk[3])
-
struct completion;
struct pt_regs;
struct user;
@@ -303,93 +275,8 @@ extern int func_ptr_is_kernel_text(void *ptr);
struct pid;
extern struct pid *session_of_pgrp(struct pid *pgrp);
-/*
- * FW_BUG
- * Add this to a message where you are sure the firmware is buggy or behaves
- * really stupid or out of spec. Be aware that the responsible BIOS developer
- * should be able to fix this issue or at least get a concrete idea of the
- * problem by reading your message without the need of looking at the kernel
- * code.
- *
- * Use it for definite and high priority BIOS bugs.
- *
- * FW_WARN
- * Use it for not that clear (e.g. could the kernel messed up things already?)
- * and medium priority BIOS bugs.
- *
- * FW_INFO
- * Use this one if you want to tell the user or vendor about something
- * suspicious, but generally harmless related to the firmware.
- *
- * Use it for information or very low priority BIOS bugs.
- */
-#define FW_BUG "[Firmware Bug]: "
-#define FW_WARN "[Firmware Warn]: "
-#define FW_INFO "[Firmware Info]: "
-
-#ifdef CONFIG_PRINTK
-asmlinkage int vprintk(const char *fmt, va_list args)
- __attribute__ ((format (printf, 1, 0)));
-asmlinkage int printk(const char * fmt, ...)
- __attribute__ ((format (printf, 1, 2))) __cold;
-
-extern struct ratelimit_state printk_ratelimit_state;
-extern int printk_ratelimit(void);
-extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
- unsigned int interval_msec);
-
-/*
- * Print a one-time message (analogous to WARN_ONCE() et al):
- */
-#define printk_once(x...) ({ \
- static int __print_once = 1; \
- \
- if (__print_once) { \
- __print_once = 0; \
- printk(x); \
- } \
-})
-
-void log_buf_kexec_setup(void);
-#else
-static inline int vprintk(const char *s, va_list args)
- __attribute__ ((format (printf, 1, 0)));
-static inline int vprintk(const char *s, va_list args) { return 0; }
-static inline int printk(const char *s, ...)
- __attribute__ ((format (printf, 1, 2)));
-static inline int __cold printk(const char *s, ...) { return 0; }
-static inline int printk_ratelimit(void) { return 0; }
-static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
- unsigned int interval_msec) \
- { return false; }
-
-/* No effect, but we still get type checking even in the !PRINTK case: */
-#define printk_once(x...) printk(x)
-
-static inline void log_buf_kexec_setup(void)
-{
-}
-#endif
-
-extern int printk_needs_cpu(int cpu);
-extern void printk_tick(void);
-
-extern void asmlinkage __attribute__((format(printf, 1, 2)))
- early_printk(const char *fmt, ...);
-
unsigned long int_sqrt(unsigned long);
-static inline void console_silent(void)
-{
- console_loglevel = 0;
-}
-
-static inline void console_verbose(void)
-{
- if (console_loglevel)
- console_loglevel = 15;
-}
-
extern void bust_spinlocks(int yes);
extern void wake_up_klogd(void);
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
@@ -397,7 +284,6 @@ extern int panic_timeout;
extern int panic_on_oops;
extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
-extern const char *print_tainted(void);
extern void add_taint(unsigned flag);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
@@ -452,183 +338,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
return buf;
}
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
-
-#define pr_emerg(fmt, ...) \
- printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_alert(fmt, ...) \
- printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_crit(fmt, ...) \
- printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_err(fmt, ...) \
- printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warning(fmt, ...) \
- printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_notice(fmt, ...) \
- printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_info(fmt, ...) \
- printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_cont(fmt, ...) \
- printk(KERN_CONT fmt, ##__VA_ARGS__)
-
-/* pr_devel() should produce zero code unless DEBUG is defined */
-#ifdef DEBUG
-#define pr_devel(fmt, ...) \
- printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#else
-#define pr_devel(fmt, ...) \
- ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
-#endif
-
-/* If you are writing a driver, please use dev_dbg instead */
-#if defined(DEBUG)
-#define pr_debug(fmt, ...) \
- printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#elif defined(CONFIG_DYNAMIC_DEBUG)
-/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
-#define pr_debug(fmt, ...) do { \
- dynamic_pr_debug(fmt, ##__VA_ARGS__); \
- } while (0)
-#else
-#define pr_debug(fmt, ...) \
- ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
-#endif
-
-/*
- * General tracing related utility functions - trace_printk(),
- * tracing_on/tracing_off and tracing_start()/tracing_stop
- *
- * Use tracing_on/tracing_off when you want to quickly turn on or off
- * tracing. It simply enables or disables the recording of the trace events.
- * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
- * file, which gives a means for the kernel and userspace to interact.
- * Place a tracing_off() in the kernel where you want tracing to end.
- * From user space, examine the trace, and then echo 1 > tracing_on
- * to continue tracing.
- *
- * tracing_stop/tracing_start has slightly more overhead. It is used
- * by things like suspend to ram where disabling the recording of the
- * trace is not enough, but tracing must actually stop because things
- * like calling smp_processor_id() may crash the system.
- *
- * Most likely, you want to use tracing_on/tracing_off.
- */
-#ifdef CONFIG_RING_BUFFER
-void tracing_on(void);
-void tracing_off(void);
-/* trace_off_permanent stops recording with no way to bring it back */
-void tracing_off_permanent(void);
-int tracing_is_on(void);
-#else
-static inline void tracing_on(void) { }
-static inline void tracing_off(void) { }
-static inline void tracing_off_permanent(void) { }
-static inline int tracing_is_on(void) { return 0; }
-#endif
-#ifdef CONFIG_TRACING
-extern void tracing_start(void);
-extern void tracing_stop(void);
-extern void ftrace_off_permanent(void);
-
-extern void
-ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
-
-static inline void __attribute__ ((format (printf, 1, 2)))
-____trace_printk_check_format(const char *fmt, ...)
-{
-}
-#define __trace_printk_check_format(fmt, args...) \
-do { \
- if (0) \
- ____trace_printk_check_format(fmt, ##args); \
-} while (0)
-
-/**
- * trace_printk - printf formatting in the ftrace buffer
- * @fmt: the printf format for printing
- *
- * Note: __trace_printk is an internal function for trace_printk and
- * the @ip is passed in via the trace_printk macro.
- *
- * This function allows a kernel developer to debug fast path sections
- * that printk is not appropriate for. By scattering in various
- * printk like tracing in the code, a developer can quickly see
- * where problems are occurring.
- *
- * This is intended as a debugging tool for the developer only.
- * Please refrain from leaving trace_printks scattered around in
- * your code.
- */
-
-#define trace_printk(fmt, args...) \
-do { \
- __trace_printk_check_format(fmt, ##args); \
- if (__builtin_constant_p(fmt)) { \
- static const char *trace_printk_fmt \
- __attribute__((section("__trace_printk_fmt"))) = \
- __builtin_constant_p(fmt) ? fmt : NULL; \
- \
- __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
- } else \
- __trace_printk(_THIS_IP_, fmt, ##args); \
-} while (0)
-
-extern int
-__trace_bprintk(unsigned long ip, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-
-extern int
-__trace_printk(unsigned long ip, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-
-/*
- * The double __builtin_constant_p is because gcc will give us an error
- * if we try to allocate the static variable to fmt if it is not a
- * constant. Even with the outer if statement.
- */
-#define ftrace_vprintk(fmt, vargs) \
-do { \
- if (__builtin_constant_p(fmt)) { \
- static const char *trace_printk_fmt \
- __attribute__((section("__trace_printk_fmt"))) = \
- __builtin_constant_p(fmt) ? fmt : NULL; \
- \
- __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
- } else \
- __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
-} while (0)
-
-extern int
-__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
-
-extern int
-__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
-
-extern void ftrace_dump(void);
-#else
-static inline void
-ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
-static inline int
-trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
-static inline void tracing_start(void) { }
-static inline void tracing_stop(void) { }
-static inline void ftrace_off_permanent(void) { }
-static inline int
-trace_printk(const char *fmt, ...)
-{
- return 0;
-}
-static inline int
-ftrace_vprintk(const char *fmt, va_list ap)
-{
- return 0;
-}
-static inline void ftrace_dump(void) { }
-#endif /* CONFIG_TRACING */
-
/*
* Display an IP address in readable format.
*/
diff --git a/include/linux/logging.h b/include/linux/logging.h
new file mode 100644
index 0000000..361d5ed
--- /dev/null
+++ b/include/linux/logging.h
@@ -0,0 +1,313 @@
+#ifndef _LINUX_LOGGING_H
+#define _LINUX_LOGGING_H
+
+#ifdef __KERNEL__
+
+extern const char linux_banner[];
+extern const char linux_proc_banner[];
+
+/*
+ * Defines used for printk logging level
+ */
+
+#define KERN_EMERG "<0>" /* system is unusable */
+#define KERN_ALERT "<1>" /* action must be taken immediately */
+#define KERN_CRIT "<2>" /* critical conditions */
+#define KERN_ERR "<3>" /* error conditions */
+#define KERN_WARNING "<4>" /* warning conditions */
+#define KERN_NOTICE "<5>" /* normal but significant condition */
+#define KERN_INFO "<6>" /* informational */
+#define KERN_DEBUG "<7>" /* debug-level messages */
+
+/* Use the default kernel loglevel */
+#define KERN_DEFAULT "<d>"
+/*
+ * Annotation for a "continued" line of log printout (only done after a
+ * line that had no enclosing \n). Only to be used by core/arch code
+ * during early bootup (a continued line is not SMP-safe otherwise).
+ */
+#define KERN_CONT "<c>"
+
+/*
+ * Console elements
+ */
+
+extern int console_printk[];
+
+#define console_loglevel (console_printk[0])
+#define default_message_loglevel (console_printk[1])
+#define minimum_console_loglevel (console_printk[2])
+#define default_console_loglevel (console_printk[3])
+
+static inline void console_silent(void)
+{
+ console_loglevel = 0;
+}
+
+static inline void console_verbose(void)
+{
+ if (console_loglevel)
+ console_loglevel = 15;
+}
+
+/*
+ * FW_BUG
+ * Add this to a message where you are sure the firmware is buggy or behaves
+ * really stupid or out of spec. Be aware that the responsible BIOS developer
+ * should be able to fix this issue or at least get a concrete idea of the
+ * problem by reading your message without the need of looking at the kernel
+ * code.
+ *
+ * Use it for definite and high priority BIOS bugs.
+ *
+ * FW_WARN
+ * Use it for not that clear (e.g. could the kernel messed up things already?)
+ * and medium priority BIOS bugs.
+ *
+ * FW_INFO
+ * Use this one if you want to tell the user or vendor about something
+ * suspicious, but generally harmless related to the firmware.
+ *
+ * Use it for information or very low priority BIOS bugs.
+ */
+#define FW_BUG "[Firmware Bug]: "
+#define FW_WARN "[Firmware Warn]: "
+#define FW_INFO "[Firmware Info]: "
+
+#ifdef CONFIG_PRINTK
+
+asmlinkage int vprintk(const char *fmt, va_list args)
+ __attribute__ ((format (printf, 1, 0)));
+asmlinkage int printk(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2))) __cold;
+
+extern struct ratelimit_state printk_ratelimit_state;
+extern int printk_ratelimit(void);
+extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+ unsigned int interval_msec);
+
+/*
+ * Print a one-time message (analogous to WARN_ONCE() et al):
+ */
+#define printk_once(fmt, ...) \
+({ \
+ static int __print_once = 1; \
+ \
+ if (__print_once) { \
+ __print_once = 0; \
+ printk(fmt, ##__VA_ARGS__); \
+ } \
+})
+
+void log_buf_kexec_setup(void);
+
+#else
+
+static inline int vprintk(const char *s, va_list args)
+ __attribute__ ((format (printf, 1, 0)));
+static inline int vprintk(const char *s, va_list args) { return 0; }
+static inline int printk(const char *s, ...)
+ __attribute__ ((format (printf, 1, 2)));
+static inline int __cold printk(const char *s, ...) { return 0; }
+static inline int printk_ratelimit(void) { return 0; }
+static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+ unsigned int interval_msec)
+{
+ return false;
+}
+
+/* No effect, but we still get type checking even in the !PRINTK case: */
+#define printk_once(fmt, ...) printk(fmt, ##__VA_ARGS__)
+
+static inline void log_buf_kexec_setup(void)
+{
+}
+
+#endif /* CONFIG_PRINTK */
+
+extern int printk_needs_cpu(int cpu);
+extern void printk_tick(void);
+
+extern void asmlinkage __attribute__((format(printf, 1, 2)))
+ early_printk(const char *fmt, ...);
+
+extern const char *print_tainted(void);
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_emerg(fmt, ...) \
+ printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_alert(fmt, ...) \
+ printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_crit(fmt, ...) \
+ printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err(fmt, ...) \
+ printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_notice(fmt, ...) \
+ printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info(fmt, ...) \
+ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_cont(fmt, ...) \
+ printk(KERN_CONT fmt, ##__VA_ARGS__)
+
+/* pr_devel() should produce zero code unless DEBUG is defined */
+#ifdef DEBUG
+#define pr_devel(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_devel(fmt, ...) \
+ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
+#endif
+
+/* If you are writing a driver, please use dev_dbg instead */
+#if defined(DEBUG)
+#define pr_debug(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#elif defined(CONFIG_DYNAMIC_DEBUG)
+/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
+#define pr_debug(fmt, ...) \
+ do { dynamic_pr_debug(fmt, ##__VA_ARGS__); } while (0)
+#else
+#define pr_debug(fmt, ...) \
+ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
+#endif
+
+/*
+ * General tracing related utility functions - trace_printk(),
+ * tracing_on/tracing_off and tracing_start()/tracing_stop
+ *
+ * Use tracing_on/tracing_off when you want to quickly turn on or off
+ * tracing. It simply enables or disables the recording of the trace events.
+ * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
+ * file, which gives a means for the kernel and userspace to interact.
+ * Place a tracing_off() in the kernel where you want tracing to end.
+ * From user space, examine the trace, and then echo 1 > tracing_on
+ * to continue tracing.
+ *
+ * tracing_stop/tracing_start has slightly more overhead. It is used
+ * by things like suspend to ram where disabling the recording of the
+ * trace is not enough, but tracing must actually stop because things
+ * like calling smp_processor_id() may crash the system.
+ *
+ * Most likely, you want to use tracing_on/tracing_off.
+ */
+#ifdef CONFIG_RING_BUFFER
+void tracing_on(void);
+void tracing_off(void);
+/* trace_off_permanent stops recording with no way to bring it back */
+void tracing_off_permanent(void);
+int tracing_is_on(void);
+#else
+static inline void tracing_on(void) { }
+static inline void tracing_off(void) { }
+static inline void tracing_off_permanent(void) { }
+static inline int tracing_is_on(void) { return 0; }
+#endif
+#ifdef CONFIG_TRACING
+extern void tracing_start(void);
+extern void tracing_stop(void);
+extern void ftrace_off_permanent(void);
+
+extern void
+ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
+
+static inline void __attribute__ ((format (printf, 1, 2)))
+____trace_printk_check_format(const char *fmt, ...)
+{
+}
+#define __trace_printk_check_format(fmt, args...) \
+do { \
+ if (0) \
+ ____trace_printk_check_format(fmt, ##args); \
+} while (0)
+
+/**
+ * trace_printk - printf formatting in the ftrace buffer
+ * @fmt: the printf format for printing
+ *
+ * Note: __trace_printk is an internal function for trace_printk and
+ * the @ip is passed in via the trace_printk macro.
+ *
+ * This function allows a kernel developer to debug fast path sections
+ * that printk is not appropriate for. By scattering in various
+ * printk like tracing in the code, a developer can quickly see
+ * where problems are occurring.
+ *
+ * This is intended as a debugging tool for the developer only.
+ * Please refrain from leaving trace_printks scattered around in
+ * your code.
+ */
+
+#define trace_printk(fmt, args...) \
+do { \
+ __trace_printk_check_format(fmt, ##args); \
+ if (__builtin_constant_p(fmt)) { \
+ static const char *trace_printk_fmt \
+ __attribute__((section("__trace_printk_fmt"))) = \
+ __builtin_constant_p(fmt) ? fmt : NULL; \
+ \
+ __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
+ } else \
+ __trace_printk(_THIS_IP_, fmt, ##args); \
+} while (0)
+
+extern int
+__trace_bprintk(unsigned long ip, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+extern int
+__trace_printk(unsigned long ip, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+/*
+ * The double __builtin_constant_p is because gcc will give us an error
+ * if we try to allocate the static variable to fmt if it is not a
+ * constant. Even with the outer if statement.
+ */
+#define ftrace_vprintk(fmt, vargs) \
+do { \
+ if (__builtin_constant_p(fmt)) { \
+ static const char *trace_printk_fmt \
+ __attribute__((section("__trace_printk_fmt"))) = \
+ __builtin_constant_p(fmt) ? fmt : NULL; \
+ \
+ __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
+ } else \
+ __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
+} while (0)
+
+extern int
+__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
+
+extern int
+__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
+
+extern void ftrace_dump(void);
+#else
+static inline void
+ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
+static inline int
+trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+
+static inline void tracing_start(void) { }
+static inline void tracing_stop(void) { }
+static inline void ftrace_off_permanent(void) { }
+static inline int
+trace_printk(const char *fmt, ...)
+{
+ return 0;
+}
+static inline int
+ftrace_vprintk(const char *fmt, va_list ap)
+{
+ return 0;
+}
+static inline void ftrace_dump(void) { }
+#endif /* CONFIG_TRACING */
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_LOGGING_H */
--
1.6.3.1.10.g659a0.dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox