All of lore.kernel.org
 help / color / mirror / Atom feed
* Using c2xml on kernel sources
@ 2012-03-20  9:00 Shakthi Kannan
  2012-03-20  9:32 ` Bernd Petrovitsch
  2012-03-20 10:37 ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Shakthi Kannan @ 2012-03-20  9:00 UTC (permalink / raw)
  To: linux-sparse

Hi,

I would like to run c2xml on the Linux kernel sources. Is there a
recommended way of using the tool on kernel code?

I tried running it directly on a source file, but, get the
'header-file "unable to open" error.

  $ c2xml linux-3.0.4/net/ethernet/eth.c

  ../linux-3.0.4/net/ethernet/eth.c:40:11: error: unable to open
'linux/module.h'

I have built sparse from git sources (v0.4.4) on Fedora 15 x86_64.

Appreciate any inputs in this regard.

Thanks!

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-03-20  9:00 Using c2xml on kernel sources Shakthi Kannan
@ 2012-03-20  9:32 ` Bernd Petrovitsch
  2012-03-20 10:37 ` Dan Carpenter
  1 sibling, 0 replies; 7+ messages in thread
From: Bernd Petrovitsch @ 2012-03-20  9:32 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: linux-sparse

Hi!
On Die, 2012-03-20 at 14:30 +0530, Shakthi Kannan wrote:
[...]
> I would like to run c2xml on the Linux kernel sources. Is there a
> recommended way of using the tool on kernel code?
> 
> I tried running it directly on a source file, but, get the
> 'header-file "unable to open" error.
> 
>   $ c2xml linux-3.0.4/net/ethernet/eth.c
> 
>   ../linux-3.0.4/net/ethernet/eth.c:40:11: error: unable to open
> 'linux/module.h'
> 
> I have built sparse from git sources (v0.4.4) on Fedora 15 x86_64.

Someone probably have to tell c2xml where to look for the .h files
similar to gcc's "-I" parameters.

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@petrovitsch.priv.at
                     LUGA : http://www.luga.at


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-03-20  9:00 Using c2xml on kernel sources Shakthi Kannan
  2012-03-20  9:32 ` Bernd Petrovitsch
@ 2012-03-20 10:37 ` Dan Carpenter
  2012-03-20 15:25   ` Shakthi Kannan
  1 sibling, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2012-03-20 10:37 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Tue, Mar 20, 2012 at 02:30:18PM +0530, Shakthi Kannan wrote:
> Hi,
> 
> I would like to run c2xml on the Linux kernel sources. Is there a
> recommended way of using the tool on kernel code?
> 
> I tried running it directly on a source file, but, get the
> 'header-file "unable to open" error.
> 
>   $ c2xml linux-3.0.4/net/ethernet/eth.c
> 

make C=2 CHECK="c2xml > foo.xml" net/ethernet/eth.o


regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-03-20 10:37 ` Dan Carpenter
@ 2012-03-20 15:25   ` Shakthi Kannan
  2012-03-20 15:40     ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Shakthi Kannan @ 2012-03-20 15:25 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-sparse

Hi Dan:

--- On Tue, Mar 20, 2012 at 4:07 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
| make C=2 CHECK="c2xml > foo.xml" net/ethernet/eth.o
\--

That worked!

But, is it really required to generate eth.o? Is it possible to just
parse through the sources, produce the .xml output without having to
generate the object files?

Thanks for your reply,

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-03-20 15:25   ` Shakthi Kannan
@ 2012-03-20 15:40     ` Dan Carpenter
  2012-05-23  9:59       ` Shakthi Kannan
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2012-03-20 15:40 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

On Tue, Mar 20, 2012 at 08:55:48PM +0530, Shakthi Kannan wrote:
> Hi Dan:
> 
> --- On Tue, Mar 20, 2012 at 4:07 PM, Dan Carpenter
> <dan.carpenter@oracle.com> wrote:
> | make C=2 CHECK="c2xml > foo.xml" net/ethernet/eth.o
> \--
> 
> That worked!
> 
> But, is it really required to generate eth.o? Is it possible to just
> parse through the sources, produce the .xml output without having to
> generate the object files?
> 

No, I can't think of an easy way.

regards,
dan carpenter.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-03-20 15:40     ` Dan Carpenter
@ 2012-05-23  9:59       ` Shakthi Kannan
  2012-05-23 18:30         ` Christopher Li
  0 siblings, 1 reply; 7+ messages in thread
From: Shakthi Kannan @ 2012-05-23  9:59 UTC (permalink / raw)
  To: linux-sparse

Hi,

Replying to my own post (for future reference):

--- On Tue, Mar 20, 2012 at 08:55:48PM +0530, Shakthi Kannan wrote:
| But, is it really required to generate eth.o? Is it possible to just
| parse through the sources, produce the .xml output without having to
| generate the object files?
\--

I had to use:

MAKEFLAGS+="--dry-run" make C=2 CHECK="c2xml > foo.xml"
net/ethernet/eth.o > output.txt

eval `tail -2 output.txt | head -1`

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using c2xml on kernel sources
  2012-05-23  9:59       ` Shakthi Kannan
@ 2012-05-23 18:30         ` Christopher Li
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Li @ 2012-05-23 18:30 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: linux-sparse

On Wed, May 23, 2012 at 2:59 AM, Shakthi Kannan <shakthimaan@gmail.com> wrote:
>
> MAKEFLAGS+="--dry-run" make C=2 CHECK="c2xml > foo.xml"
> net/ethernet/eth.o > output.txt
>
> eval `tail -2 output.txt | head -1`
>

That is a great tip.

Thanks.

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-23 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20  9:00 Using c2xml on kernel sources Shakthi Kannan
2012-03-20  9:32 ` Bernd Petrovitsch
2012-03-20 10:37 ` Dan Carpenter
2012-03-20 15:25   ` Shakthi Kannan
2012-03-20 15:40     ` Dan Carpenter
2012-05-23  9:59       ` Shakthi Kannan
2012-05-23 18:30         ` Christopher Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.