aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <swo-dev@marcschink.de>2016-09-18 15:51:25 +0200
committerMarc Schink <swo-dev@marcschink.de>2016-09-18 22:05:23 +0200
commit3276befe985c41f569c148a01cbcd9a10e197dd8 (patch)
treee26c8423c6e4eef23044e7b3603a530cfb11bdc5
parent191d53d58f4d029ba73d5cb7ce52ed6118710d6a (diff)
Update for packet type rearrangement
-rw-r--r--src/main.c16
-rw-r--r--src/swodec.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 9c890b2..62b3886 100644
--- a/src/main.c
+++ b/src/main.c
@@ -71,7 +71,9 @@ static gboolean parse_filter_option(const gchar *option_name,
continue;
}
- if (!g_ascii_strcasecmp(tokens[i], "sync")) {
+ if (!g_ascii_strcasecmp(tokens[i], "unknown")) {
+ tmp |= (1 << LIBSWO_PACKET_TYPE_UNKNOWN);
+ } else if (!g_ascii_strcasecmp(tokens[i], "sync")) {
tmp |= (1 << LIBSWO_PACKET_TYPE_SYNC);
} else if (!g_ascii_strcasecmp(tokens[i], "of")) {
tmp |= (1 << LIBSWO_PACKET_TYPE_OVERFLOW);
@@ -109,8 +111,6 @@ static gboolean parse_filter_option(const gchar *option_name,
tmp |= (1 << DWT_PACKET_TYPE_DT_ADDR_OFFSET);
} else if (!g_ascii_strcasecmp(tokens[i], "dtval")) {
tmp |= (1 << DWT_PACKET_TYPE_DT_DATA_VALUE);
- } else if (!g_ascii_strcasecmp(tokens[i], "unknown")) {
- tmp |= (1 << LIBSWO_PACKET_TYPE_UNKNOWN);
} else {
g_critical("Invalid packet type: %s.", tokens[i]);
g_strfreev(tokens);
@@ -358,6 +358,9 @@ static int packet_cb(struct libswo_context *ctx,
(void)user_data;
switch (packet->type) {
+ case LIBSWO_PACKET_TYPE_UNKNOWN:
+ handle_unknown_packet(packet);
+ break;
case LIBSWO_PACKET_TYPE_SYNC:
handle_sync_packet(packet);
break;
@@ -382,9 +385,6 @@ static int packet_cb(struct libswo_context *ctx,
case LIBSWO_PACKET_TYPE_HW:
handle_hw_packet(packet);
break;
- case LIBSWO_PACKET_TYPE_UNKNOWN:
- handle_unknown_packet(packet);
- break;
default:
g_warning("Invalid packet type: %u.", packet->type);
break;
@@ -448,7 +448,8 @@ int main(int argc, char **argv)
opt_dump_inst = FALSE;
/* Disable packet filtering for all packet types by default. */
- packet_type_filter = (1 << LIBSWO_PACKET_TYPE_SYNC) | \
+ packet_type_filter = (1 << LIBSWO_PACKET_TYPE_UNKNOWN) | \
+ (1 << LIBSWO_PACKET_TYPE_SYNC) | \
(1 << LIBSWO_PACKET_TYPE_OVERFLOW) | \
(1 << LIBSWO_PACKET_TYPE_LTS) | \
(1 << LIBSWO_PACKET_TYPE_GTS1) | \
@@ -456,7 +457,6 @@ int main(int argc, char **argv)
(1 << LIBSWO_PACKET_TYPE_EXT) | \
(1 << LIBSWO_PACKET_TYPE_INST) | \
(1 << LIBSWO_PACKET_TYPE_HW) | \
- (1 << LIBSWO_PACKET_TYPE_UNKNOWN) | \
(1 << DWT_PACKET_TYPE_EVENT_COUNTER) | \
(1 << DWT_PACKET_TYPE_EXCEPTION_TRACE) | \
(1 << DWT_PACKET_TYPE_PC_SAMPLE) | \
diff --git a/src/swodec.h b/src/swodec.h
index f44a46a..08eed3f 100644
--- a/src/swodec.h
+++ b/src/swodec.h
@@ -25,7 +25,7 @@
/* Data Watchpoint and Trace (DWT) packet types. */
enum dwt_packet_type {
/* Event counter packet. */
- DWT_PACKET_TYPE_EVENT_COUNTER = LIBSWO_PACKET_TYPE_UNKNOWN + 1,
+ DWT_PACKET_TYPE_EVENT_COUNTER = LIBSWO_PACKET_TYPE_HW + 1,
/* Exception trace packet. */
DWT_PACKET_TYPE_EXCEPTION_TRACE,
/* Periodic PC sample packet. */