diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-11-04 06:48:06 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-11-04 06:48:06 +0100 |
commit | 14883d64dde384fc0d671d33c058fbdb3aa8bb11 (patch) | |
tree | 78b60156e30e3b158e18225f37eb2de53fb08bad /monitor | |
parent | 2290fbb9f5f0d1aa5b4f2b5529d0427af0bf3479 (diff) | |
download | bluez-14883d64dde384fc0d671d33c058fbdb3aa8bb11.tar.gz |
monitor: Do not show index for single controller trace files
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/btsnoop.c | 11 | ||||
-rw-r--r-- | monitor/control.c | 2 | ||||
-rw-r--r-- | monitor/main.c | 1 | ||||
-rw-r--r-- | monitor/packet.c | 10 | ||||
-rw-r--r-- | monitor/packet.h | 2 |
5 files changed, 25 insertions, 1 deletions
diff --git a/monitor/btsnoop.c b/monitor/btsnoop.c index 147e9ee46..04a6dff17 100644 --- a/monitor/btsnoop.c +++ b/monitor/btsnoop.c @@ -198,6 +198,17 @@ int btsnoop_open(const char *path) btsnoop_type = ntohl(hdr.type); + switch (btsnoop_type) { + case 1001: + case 1002: + packet_del_filter(PACKET_FILTER_SHOW_INDEX); + break; + + case 2001: + packet_add_filter(PACKET_FILTER_SHOW_INDEX); + break; + } + return 0; } diff --git a/monitor/control.c b/monitor/control.c index 49df44012..638d1733e 100644 --- a/monitor/control.c +++ b/monitor/control.c @@ -795,6 +795,8 @@ void control_reader(const char *path) int control_tracing(void) { + packet_add_filter(PACKET_FILTER_SHOW_INDEX); + if (server_fd >= 0) return 0; diff --git a/monitor/main.c b/monitor/main.c index 7ea7773e9..9307f5299 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -109,7 +109,6 @@ int main(int argc, char *argv[]) mainloop_set_signal(&mask, signal_callback, NULL, NULL); - filter_mask |= PACKET_FILTER_SHOW_INDEX; filter_mask |= PACKET_FILTER_SHOW_TIME; packet_set_filter(filter_mask); diff --git a/monitor/packet.c b/monitor/packet.c index f5d1c17cf..fd9e66372 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -98,6 +98,16 @@ void packet_set_filter(unsigned long filter) filter_mask = filter; } +void packet_add_filter(unsigned long filter) +{ + filter_mask |= filter; +} + +void packet_del_filter(unsigned long filter) +{ + filter_mask &= ~filter; +} + static void print_channel_header(struct timeval *tv, uint16_t index, uint16_t channel) { diff --git a/monitor/packet.h b/monitor/packet.h index ea21bd7f6..29fab66de 100644 --- a/monitor/packet.h +++ b/monitor/packet.h @@ -33,6 +33,8 @@ #define PACKET_FILTER_SHOW_SCO_DATA (1 << 4) void packet_set_filter(unsigned long filter); +void packet_add_filter(unsigned long filter); +void packet_del_filter(unsigned long filter); void packet_hexdump(const unsigned char *buf, uint16_t len); |