Record Events happening in Supplicant Module in a log file inside the phone with Timing Information

Cainikov, Andrej Andrej.Cainikov
Thu Oct 13 12:25:57 PDT 2011


Nithy,

I don't know what you are trying to achieve, but you can redirect wpa_supplicant log to a file. Have a look into src/utils/wpa_debug.*.
This should be achievable by swapping CONFIG_ANDROID_LOG to CONFIG_DEBUG_FILE in .config file, and executing wpa_supplicant with "-f /data/wpa_supplicant.log".
Then just add any additional printout's you need by using wpa_supplicant logging functions (wpa_printf and friends) - all the logging will fall in a single log file, ready to be processed by your handy scripts.

Regards,
Andrejs Cainikovs.

From: Nithyananthan Poosamani [mailto:nithy.psg at gmail.com]
Sent: den 13 oktober 2011 19:44
To: Cainikov, Andrej
Cc: hostap at shmoo.com
Subject: Re: Record Events happening in Supplicant Module in a log file inside the phone with Timing Information

Andrej,

Thank you for the quick reply. I tried your solution and also added filter to filter the tags which I want instead of logging everything from the circular buffer. Currently, this should work fine for me and I am planning to add these commands to init.rc file so that they can start upon phone boot.
I identified the place where the logging daemon service is started in init.rc file. Below you can see part of init.rc file where the shell process is spawned.

## Daemon processes to be run by init.
##
service ueventd /sbin/ueventd
    critical

service console /system/bin/sh
    console
    disabled
    user shell
    group log

I have 2 questions:
1) Do you want me to add the logcat commands in any specific place in init.rc file?
2) For my next steps, I am planning to read and write some information like SSID name, freq etc in a file other then wpa_supplicant.conf file from within the wpa_supplicant daemon service. That's the reason I asked to log events directly form wpa_supplicant in my first email.

thanks all !

Sincerely,
Nithy



On Wed, Oct 12, 2011 at 12:36 PM, Cainikov, Andrej <Andrej.Cainikov at sonyericsson.com<mailto:Andrej.Cainikov at sonyericsson.com>> wrote:
Hi Nithy,

What are you asking for has nothing to do with the wpa_supplicant itself, but rather to Android specifics.

Collecting the logs on Android phone without USB cable normally is achieved via:
$ adb wait-for-device shell
$ logcat -v threadtime > /data/logcat.log &

Br,
Andrejs Cainikovs.

From: hostap-bounces at lists.shmoo.com<mailto:hostap-bounces at lists.shmoo.com> [mailto:hostap-bounces at lists.shmoo.com<mailto:hostap-bounces at lists.shmoo.com>] On Behalf Of Nithyananthan Poosamani
Sent: den 12 oktober 2011 18:12
To: hostap at shmoo.com<mailto:hostap at shmoo.com>
Subject: Record Events happening in Supplicant Module in a log file inside the phone with Timing Information

Dear All,

I am working to record some of the events happening in wpa_supplicant module like how many times the configuration file is read by supplicant to populate it's data structures, what time it happened, number of scans performed and their timing information etc.

I have a rooted Nexus One phone which uses the wext driver. Currently, I would kill the wpa_supplicant process and start it with advanced log level to see all these information. The command I used is

wpa_supplicant -Dwext -ieth0 -c/data/misc/wifi/wpa_supplicant.conf -dd

But I was able to see all these logs ONLY when I am connected to ADB interface through Eclipse. What I want is that I need to see all the logs even when the phone is not connected to ADB. I would like to store all these log information as a file inside the smartphone which I can later retrieve. Example the file could be logged in /data/misc/wifi/supplicant_log.txt. I shall later parse this log file and gather some information.

Please guide me in achieving this. Thank you all for your time and patience !

Sincerely,
Nithy
--
Networking Research Laboratory (NRL)
NC State University.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20111013/6df27ee2/attachment.htm 



More information about the Hostap mailing list