Diff between 30a4fdcbfe8de30503012733ebdb3dc58ccd73fb and f9b8fac243a2b21ed3d06b9892b886cc824e302e

Changed Files

File Additions Deletions Status
monitor/analyze.c +20 -0 modified

Full Patch

diff --git a/monitor/analyze.c b/monitor/analyze.c
index 9f6d986..aac5c39 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -38,6 +38,7 @@ struct hci_dev {
 	unsigned long vendor_diag;
 	unsigned long system_note;
 	unsigned long user_log;
+	unsigned long ctrl_msg;
 	unsigned long unknown;
 	uint16_t manufacturer;
 };
@@ -78,6 +79,7 @@ static void dev_destroy(void *data)
 	printf("  %lu vendor diagnostics\n", dev->vendor_diag);
 	printf("  %lu system notes\n", dev->system_note);
 	printf("  %lu user logs\n", dev->user_log);
+	printf("  %lu control messages \n", dev->ctrl_msg);
 	printf("  %lu unknown opcodes\n", dev->unknown);
 	printf("\n");
 
@@ -301,6 +303,18 @@ static void user_log(struct timeval *tv, uint16_t index,
 	dev->user_log++;
 }
 
+static void ctrl_msg(struct timeval *tv, uint16_t index,
+					const void *data, uint16_t size)
+{
+	struct hci_dev *dev;
+
+	dev = dev_lookup(index);
+	if (!dev)
+		return;
+
+	dev->ctrl_msg++;
+}
+
 static void iso_pkt(struct timeval *tv, uint16_t index,
 					const void *data, uint16_t size)
 {
@@ -398,6 +412,12 @@ void analyze_trace(const char *path)
 		case BTSNOOP_OPCODE_USER_LOGGING:
 			user_log(&tv, index, buf, pktlen);
 			break;
+		case BTSNOOP_OPCODE_CTRL_OPEN:
+		case BTSNOOP_OPCODE_CTRL_CLOSE:
+		case BTSNOOP_OPCODE_CTRL_COMMAND:
+		case BTSNOOP_OPCODE_CTRL_EVENT:
+			ctrl_msg(&tv, index, buf, pktlen);
+			break;
 		case BTSNOOP_OPCODE_ISO_TX_PKT:
 		case BTSNOOP_OPCODE_ISO_RX_PKT:
 			iso_pkt(&tv, index, buf, pktlen);