aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-10-30 18:29:58 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-31 08:47:44 (GMT)
commit0648c3b8f5c38bc2206758738278e074f6f5b11b (patch)
tree6ec92086762cc7b599081d384c4f20b263c823a8 /hostapd/main.c
parentf62ec3696d5c850d86a2a95c7e900125ab4b3074 (diff)
downloadhostap-0648c3b8f5c38bc2206758738278e074f6f5b11b.zip
hostap-0648c3b8f5c38bc2206758738278e074f6f5b11b.tar.gz
hostap-0648c3b8f5c38bc2206758738278e074f6f5b11b.tar.bz2
hostapd: Add -T Linux tracing option
Just like wpa_supplicant, give hostapd the -T option to send all debug messages into the Linux tracing buffer. Enable this option for hwsim test builds by default. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 23eef1a..6041799 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -629,6 +629,10 @@ static void usage(void)
#ifdef CONFIG_DEBUG_FILE
" -f log output to debug file instead of stdout\n"
#endif /* CONFIG_DEBUG_FILE */
+#ifdef CONFIG_DEBUG_LINUX_TRACING
+ " -T = record to Linux tracing in addition to logging\n"
+ " (records all messages regardless of debug verbosity)\n"
+#endif /* CONFIG_DEBUG_LINUX_TRACING */
" -t include timestamps in some debug messages\n"
" -v show hostapd version\n");
@@ -697,6 +701,9 @@ int main(int argc, char *argv[])
const char *entropy_file = NULL;
char **bss_config = NULL, **tmp_bss;
size_t num_bss_configs = 0;
+#ifdef CONFIG_DEBUG_LINUX_TRACING
+ int enable_trace_dbg = 0;
+#endif /* CONFIG_DEBUG_LINUX_TRACING */
if (os_program_init())
return -1;
@@ -713,7 +720,7 @@ int main(int argc, char *argv[])
interfaces.global_ctrl_sock = -1;
for (;;) {
- c = getopt(argc, argv, "b:Bde:f:hKP:tvg:G:");
+ c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
if (c < 0)
break;
switch (c) {
@@ -744,6 +751,11 @@ int main(int argc, char *argv[])
case 't':
wpa_debug_timestamp++;
break;
+#ifdef CONFIG_DEBUG_LINUX_TRACING
+ case 'T':
+ enable_trace_dbg = 1;
+ break;
+#endif /* CONFIG_DEBUG_LINUX_TRACING */
case 'v':
show_version();
exit(1);
@@ -779,6 +791,15 @@ int main(int argc, char *argv[])
if (log_file)
wpa_debug_open_file(log_file);
+#ifdef CONFIG_DEBUG_LINUX_TRACING
+ if (enable_trace_dbg) {
+ int tret = wpa_debug_open_linux_tracing();
+ if (tret) {
+ wpa_printf(MSG_ERROR, "Failed to enable trace logging");
+ return -1;
+ }
+ }
+#endif /* CONFIG_DEBUG_LINUX_TRACING */
interfaces.count = argc - optind;
if (interfaces.count || num_bss_configs) {
@@ -867,6 +888,7 @@ int main(int argc, char *argv[])
if (log_file)
wpa_debug_close_file();
+ wpa_debug_close_linux_tracing();
os_free(bss_config);