Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Garance A Drosehn
At 2:08 PM + 2/12/09, Andrew Brampton wrote: I found this useful tool called pahole[1]. It basically finds holes within structs, so for example on my 64bit machine this struct: struct test { int foo; const char *bar; int blah; } Would have a hole between foo and bar of 4 bytes beca

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Nate Eldredge
On Thu, 12 Feb 2009, Marcel Moolenaar wrote: On Feb 12, 2009, at 8:34 AM, Jille Timmermans wrote: Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatic

Re: bus_setup_intr (9)

2009-02-12 Thread Kip Macy
in HEAD, see intr_event_handle in sys/kern/kern_intr.c Cheers, Kip On Thu, Feb 12, 2009 at 12:31 PM, Alexej Sokolov wrote: > hello, > > from man: > int > bus_setup_intr(device_t dev, struct resource *r, int flags, > driver_filter_t filter, driver_intr_t ithread, void *arg, >

Re: bus_setup_intr (9)

2009-02-12 Thread Paolo Pisati
Alexej Sokolov wrote: from man: int bus_setup_intr(device_t dev, struct resource *r, int flags, driver_filter_t filter, driver_intr_t ithread, void *arg, void **cookiep); The function filter returns value of type driver_filter_t (int). This function will run if interrupt

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Marcel Moolenaar
On Feb 12, 2009, at 8:34 AM, Jille Timmermans wrote: Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing in

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Bakul Shah
> So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > many of the struct had holes, and some of which could be rearranged to > fill the gap. ... > Certainly plugging holes can also be beneficial but just cautioning that > changes of this sort need to be checked if

bus_setup_intr (9)

2009-02-12 Thread Alexej Sokolov
hello, from man: int bus_setup_intr(device_t dev, struct resource *r, int flags, driver_filter_t filter, driver_intr_t ithread, void *arg, void **cookiep); The function filter returns value of type driver_filter_t (int). This function will run if interrupt happen. Questio

Re: strange output in /var/log/messages

2009-02-12 Thread Alexej Sokolov
2009/2/12 Stefan Lambrev > Hi, > On Feb 12, 2009, at 6:57 PM, Alexej Sokolov wrote: > > Hello, > I try now to debug a kernel module and I make some output with printf(9). > But the text appears in /var/log/messages in very strange form: > > Feb 12 17:54:34 myhost kernel: b > Feb 12 17:54:34 myhos

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
On Thu, 12 Feb 2009, Max Laier wrote: So to answer your first question, submitting 101 patches to rearrange 101 structs is certainly a wasted effort. However, if you take a good look at the 2000 holes, identify an interesting subset and submit a patch to fix that subset ... that would be a wo

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Sam Leffler
Max Laier wrote: On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rea

Re: strange output in /var/log/messages

2009-02-12 Thread Stefan Lambrev
Hi, On Feb 12, 2009, at 6:57 PM, Alexej Sokolov wrote: Hello, I try now to debug a kernel module and I make some output with printf(9). But the text appears in /var/log/messages in very strange form: Feb 12 17:54:34 myhost kernel: b Feb 12 17:54:34 myhost kernel: eg Feb 12 17:54:34 myhost k

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
On Thu, 12 Feb 2009, Ed Schouten wrote: * Max Laier wrote: So to answer your first question, submitting 101 patches to rearrange 101 structs is certainly a wasted effort. However, if you take a good look at the 2000 holes, identify an interesting subset and submit a patch to fix that subset .

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
On Thu, 12 Feb 2009, Max Laier wrote: That's the tricky part. Rearranging the structs itself is not that difficult, but identifying which should be rearranged and if, how ... that's the problem. The fact that gaps might be different for 64 vs. 32 bit architectures has already been mentioned.

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Julian Stacey
Hi, Reference: > From: Jille Timmermans > Date: Thu, 12 Feb 2009 17:34:23 +0100 > Message-id: <49944f8f.5080...@quis.cx> Jille Timmermans wrote: > Julian Stacey schreef: > >> 1) Is it worth my time trying to rearrange structs? > > > > I wondered whether as a sensitivity tes

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Brooks Davis
On Thu, Feb 12, 2009 at 05:54:24PM +0100, Max Laier wrote: > On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: > > Max Laier wrote: > > > On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: > > >> So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > > >> many of the

strange output in /var/log/messages

2009-02-12 Thread Alexej Sokolov
Hello, I try now to debug a kernel module and I make some output with printf(9). But the text appears in /var/log/messages in very strange form: Feb 12 17:54:34 myhost kernel: b Feb 12 17:54:34 myhost kernel: eg Feb 12 17:54:34 myhost kernel: in Feb 12 17:54:34 myhost kernel: . Feb 12 17:54:34 myh

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Max Laier
On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: > Max Laier wrote: > > On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: > >> So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > >> many of the struct had holes, and some of which could be rearranged to > >> fill

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Jille Timmermans
Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing in man gcc "Optimization Options". There is a __packed at

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Sam Leffler
Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rearranged to fill the gap. Interesting tool ... Someone should be able to do t

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Ed Schouten
* Max Laier wrote: > So to answer your first question, submitting 101 patches to rearrange 101 > structs is certainly a wasted effort. However, if you take a good look at > the > 2000 holes, identify an interesting subset and submit a patch to fix that > subset ... that would be a worthwhile

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Max Laier
On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: > So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > many of the struct had holes, and some of which could be rearranged to > fill the gap. Interesting tool ... > I've made the list available here[2]. So

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Julian Stacey
> 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing in man gcc "Optimization Options". Cheers, Julian -- Julian Stacey: BSDUnixLin

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Harald Servat
On Thu, Feb 12, 2009 at 3:13 PM, Kostik Belousov wrote: > On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: > > I found this useful tool called pahole[1]. It basically finds holes > > within structs, so for example on my 64bit machine this struct: > > > > struct test { > >int fo

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Andrew Brampton
2009/2/12 Kostik Belousov : > On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: >> >> So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > Did you ported it to FreeBSD, or run on the Linux host ? > Sorry no, I just ran it from a Linux host, but to my surprised it see

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Kostik Belousov
On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: > I found this useful tool called pahole[1]. It basically finds holes > within structs, so for example on my 64bit machine this struct: > > struct test { >int foo; >const char *bar; >int blah; > } > > Would have a hole b

pahole - Finding holes in kernel structs

2009-02-12 Thread Andrew Brampton
I found this useful tool called pahole[1]. It basically finds holes within structs, so for example on my 64bit machine this struct: struct test { int foo; const char *bar; int blah; } Would have a hole between foo and bar of 4 bytes because both for and bar have been aligned on a 8 byte

Re: How to troubleshoot why ath0 can't connect to a passwordless wireless network?

2009-02-12 Thread Paul B. Mahol
On 2/10/09, Yuri wrote: > Quoting "Sam Leffler" : > >> You seem to say your network is open (no security). If not you need >> to show your network configuration. > > That's right, network is open (no security). > >> tcpdump can be used to tap traffic at 3 layers: 802.3, 802.11, and >> driver. It

Re: userland driver?

2009-02-12 Thread Robert Watson
On Wed, 11 Feb 2009, Andriy Gapon wrote: has anybody tried anything in the area of userland drivers on FreeBSD? I mean a driver for something sufficiently simple and standalone and not driven by interrupts. E.g. some sort of a watchdog driver that simply reads/writes some io registers from ti

Re: a little bit of c++ in kernel [module]

2009-02-12 Thread Andriy Gapon
on 11/02/2009 23:51 Christoph Mallon said the following: > Aniruddha Bohra schrieb: >> On Wed, Feb 11, 2009 at 8:25 AM, Andriy Gapon wrote: [snip] >>> 3. I assume virtual inheritance can be used in kernel code? do you >>> use it? > > Virtual inheritence needs no support from the "outside", so it