Monitor kernel variable with ddb(4)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Monitor kernel variable with ddb(4)

Farhan Khan
Hi all,

I am trying to figure out where a net80211's vap flags are modified. I see
that memory is originally allocated here:
http://src.illumos.org/source/xref/freebsd-head/sys/net/if.c#445. However,
I cannot figure out where the ifp->if_flags and if->if_drv_flags are ever
modified in the kernel.

Someone suggested using ddb(4), so I entered the live debugger using sysctl
debug.kdb.enter=1

I then set a breakpoint at if_alloc.

However, I cannot seem to figure out the next steps to monitor where the
ifp->if_flags or if->if_drv_flags are updated.

Full explanation - My kernel module is immediately unloading, but I am not
certain why. I traced it back in the ieee80211 code to those flags, but not
sure where they are updated.

Any ideas? Thank you!
--
Farhan Khan
PGP Fingerprint: 782F 342B 5B08 0D2F F4E8 82C3 FFA1 CAE1 6536 51CA
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Monitor kernel variable with ddb(4)

Andriy Voskoboinyk
Sat, 12 Aug 2017 22:42:21 +0300 було написано Farhan Khan
<[hidden email]>:

> Hi all,
>
> I am trying to figure out where a net80211's vap flags are modified. I  
> see
> that memory is originally allocated here:
> http://src.illumos.org/source/xref/freebsd-head/sys/net/if.c#445.  
> However,
> I cannot figure out where the ifp->if_flags and if->if_drv_flags are ever
> modified in the kernel.
>
> Someone suggested using ddb(4), so I entered the live debugger using  
> sysctl
> debug.kdb.enter=1
>
> I then set a breakpoint at if_alloc.
>
> However, I cannot seem to figure out the next steps to monitor where the
> ifp->if_flags or if->if_drv_flags are updated.
>
> Full explanation - My kernel module is immediately unloading, but I am  
> not
> certain why. I traced it back in the ieee80211 code to those flags, but  
> not
> sure where they are updated.
>
> Any ideas? Thank you!

Hi,

You can use 'show all vaps/a' command to show all currently existing vaps
(see ieee80211_ddb(9) for other commands).
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Monitor kernel variable with ddb(4)

Eugene Grosbein-10
In reply to this post by Farhan Khan
13.08.2017 2:42, Farhan Khan пишет:

> Hi all,
>
> I am trying to figure out where a net80211's vap flags are modified. I see
> that memory is originally allocated here:
> http://src.illumos.org/source/xref/freebsd-head/sys/net/if.c#445. However,
> I cannot figure out where the ifp->if_flags and if->if_drv_flags are ever
> modified in the kernel.
>
> Someone suggested using ddb(4), so I entered the live debugger using sysctl
> debug.kdb.enter=1
>
> I then set a breakpoint at if_alloc.
>
> However, I cannot seem to figure out the next steps to monitor where the
> ifp->if_flags or if->if_drv_flags are updated.
>
> Full explanation - My kernel module is immediately unloading, but I am not
> certain why. I traced it back in the ieee80211 code to those flags, but not
> sure where they are updated.
>
> Any ideas? Thank you!

What driver do you use? There are lots of kernel level files
that change ifp->if_flags and if->if_drv_flags:

$ grep -lER '\<if(_drv)?_flags =' /usr/src/sys | wc -l
    148

Perhaps, you need ieee80211_vap_setup() function in the /usr/src/sys/net80211/ieee80211.c
or if_setdrvflagbits() in the /usr/src/sys/net/if.c or one of many driver source files
in /usr/src/sys/dev


_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Loading...