aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Doxyfile.in4
-rw-r--r--Makefile.am8
-rw-r--r--NEWS5
-rw-r--r--bindings/cxx/Makefile.am2
-rw-r--r--bindings/cxx/addressoffset.cpp2
-rw-r--r--bindings/cxx/context.cpp10
-rw-r--r--bindings/cxx/datavalue.cpp2
-rw-r--r--bindings/cxx/error.cpp2
-rw-r--r--bindings/cxx/eventcounter.cpp2
-rw-r--r--bindings/cxx/exceptiontrace.cpp8
-rw-r--r--bindings/cxx/extension.cpp2
-rw-r--r--bindings/cxx/globaltimestamp1.cpp2
-rw-r--r--bindings/cxx/globaltimestamp2.cpp2
-rw-r--r--bindings/cxx/hardware.cpp2
-rw-r--r--bindings/cxx/include/libswocxx/libswocxx.hpp (renamed from bindings/cxx/include/libswocxx/libswocxx.h)70
-rw-r--r--bindings/cxx/instrumentation.cpp2
-rw-r--r--bindings/cxx/localtimestamp.cpp2
-rw-r--r--bindings/cxx/overflow.cpp2
-rw-r--r--bindings/cxx/packet.cpp2
-rw-r--r--bindings/cxx/payloadpacket.cpp6
-rw-r--r--bindings/cxx/pcsample.cpp2
-rw-r--r--bindings/cxx/pcvalue.cpp2
-rw-r--r--bindings/cxx/sourcepacket.cpp6
-rw-r--r--bindings/cxx/synchronization.cpp2
-rw-r--r--bindings/cxx/unknown.cpp2
-rw-r--r--bindings/cxx/version.cpp6
-rw-r--r--bindings/python/Context.h2
-rw-r--r--bindings/python/Makefile.am9
-rw-r--r--bindings/python/enums.py62
-rw-r--r--bindings/python/swopy.i51
-rw-r--r--configure.ac2
-rw-r--r--examples/decoder.cpp8
-rw-r--r--examples/decoder.py56
-rw-r--r--libswo/core.c33
-rw-r--r--libswo/decoder.c6
-rw-r--r--libswo/dwt.c30
-rw-r--r--libswo/libswo.h20
37 files changed, 257 insertions, 179 deletions
diff --git a/Doxyfile.in b/Doxyfile.in
index eb97586..c89e8b2 100644
--- a/Doxyfile.in
+++ b/Doxyfile.in
@@ -779,8 +779,8 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = libswo/libswo-internal.h \
- libswo/buffer.c
+EXCLUDE = @top_srcdir@/libswo/libswo-internal.h \
+ @top_srcdir@/libswo/buffer.c
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
diff --git a/Makefile.am b/Makefile.am
index 219f0ce..d79059b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,9 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
+# Disable Python bindings on distcheck since setuptools cause problems.
+DISTCHECK_CONFIGURE_FLAGS = --disable-python
+
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libswo
@@ -32,4 +35,7 @@ if BINDINGS_PYTHON
SUBDIRS += bindings/python
endif
-EXTRA_DIST = HACKING Doxyfile
+EXTRA_DIST = \
+ HACKING \
+ examples/decoder.cpp \
+ examples/decoder.py
diff --git a/NEWS b/NEWS
index eb86c77..90b7eb1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,7 @@
News
====
+
+0.1.0 (2017-10-03)
+------------------
+
+ * Initial release.
diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
index 8014a4a..1fd1e87 100644
--- a/bindings/cxx/Makefile.am
+++ b/bindings/cxx/Makefile.am
@@ -48,4 +48,4 @@ libswocxx_la_LDFLAGS = $(LIBSWO_LDFLAGS) -no-undefined
libswocxx_la_LIBADD = $(top_builddir)/libswo/libswo.la
library_includedir = $(includedir)/libswocxx
-library_include_HEADERS = include/libswocxx/libswocxx.h
+library_include_HEADERS = include/libswocxx/libswocxx.hpp
diff --git a/bindings/cxx/addressoffset.cpp b/bindings/cxx/addressoffset.cpp
index 7e6474b..9077c5b 100644
--- a/bindings/cxx/addressoffset.cpp
+++ b/bindings/cxx/addressoffset.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/context.cpp b/bindings/cxx/context.cpp
index c8e3926..2dacf9e 100644
--- a/bindings/cxx/context.cpp
+++ b/bindings/cxx/context.cpp
@@ -23,7 +23,7 @@
#include <string>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
@@ -77,7 +77,7 @@ void Context::set_log_level(LogLevel level)
throw Error(ret);
}
-string Context::get_log_domain(void) const
+std::string Context::get_log_domain(void) const
{
const char *tmp;
@@ -89,7 +89,7 @@ string Context::get_log_domain(void) const
return tmp;
}
-void Context::set_log_domain(const string &domain)
+void Context::set_log_domain(const std::string &domain)
{
int ret;
@@ -184,7 +184,7 @@ static int packet_callback(struct libswo_context *ctx,
case LIBSWO_PACKET_TYPE_SYNC:
tmp = new Synchronization(packet);
break;
- case LIBSWO_PACKET_TYPE_OVERFLOW:
+ case LIBSWO_PACKET_TYPE_OF:
tmp = new Overflow(packet);
break;
case LIBSWO_PACKET_TYPE_LTS:
@@ -211,7 +211,7 @@ static int packet_callback(struct libswo_context *ctx,
case LIBSWO_PACKET_TYPE_DWT_EVTCNT:
tmp = new EventCounter(packet);
break;
- case LIBSWO_PACKET_TYPE_DWT_EXCTRACE:
+ case LIBSWO_PACKET_TYPE_DWT_EXCTRC:
tmp = new ExceptionTrace(packet);
break;
case LIBSWO_PACKET_TYPE_DWT_PC_SAMPLE:
diff --git a/bindings/cxx/datavalue.cpp b/bindings/cxx/datavalue.cpp
index 5196321..0cf8bdc 100644
--- a/bindings/cxx/datavalue.cpp
+++ b/bindings/cxx/datavalue.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/error.cpp b/bindings/cxx/error.cpp
index f7cf344..798c3e3 100644
--- a/bindings/cxx/error.cpp
+++ b/bindings/cxx/error.cpp
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/eventcounter.cpp b/bindings/cxx/eventcounter.cpp
index eb25e29..5663e00 100644
--- a/bindings/cxx/eventcounter.cpp
+++ b/bindings/cxx/eventcounter.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/exceptiontrace.cpp b/bindings/cxx/exceptiontrace.cpp
index cf64855..b5b85d5 100644
--- a/bindings/cxx/exceptiontrace.cpp
+++ b/bindings/cxx/exceptiontrace.cpp
@@ -19,13 +19,13 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
ExceptionTrace::ExceptionTrace(
- const struct libswo_packet_dwt_exctrace *packet) :
+ const struct libswo_packet_dwt_exctrc *packet) :
Hardware((const struct libswo_packet_hw *)packet)
{
}
@@ -37,12 +37,12 @@ ExceptionTrace::ExceptionTrace(const union libswo_packet *packet) :
uint16_t ExceptionTrace::get_exception(void) const
{
- return _packet.exctrace.exception;
+ return _packet.exctrc.exception;
}
ExceptionTraceFunction ExceptionTrace::get_function(void) const
{
- return static_cast<ExceptionTraceFunction>(_packet.exctrace.function);
+ return static_cast<ExceptionTraceFunction>(_packet.exctrc.function);
}
const std::string ExceptionTrace::to_string(void) const
diff --git a/bindings/cxx/extension.cpp b/bindings/cxx/extension.cpp
index b8123d7..8ab8b4a 100644
--- a/bindings/cxx/extension.cpp
+++ b/bindings/cxx/extension.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/globaltimestamp1.cpp b/bindings/cxx/globaltimestamp1.cpp
index 32e0204..b23b286 100644
--- a/bindings/cxx/globaltimestamp1.cpp
+++ b/bindings/cxx/globaltimestamp1.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/globaltimestamp2.cpp b/bindings/cxx/globaltimestamp2.cpp
index da95577..9e23baf 100644
--- a/bindings/cxx/globaltimestamp2.cpp
+++ b/bindings/cxx/globaltimestamp2.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/hardware.cpp b/bindings/cxx/hardware.cpp
index 3eca462..748b7d4 100644
--- a/bindings/cxx/hardware.cpp
+++ b/bindings/cxx/hardware.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/include/libswocxx/libswocxx.h b/bindings/cxx/include/libswocxx/libswocxx.hpp
index cf36cff..7f70455 100644
--- a/bindings/cxx/include/libswocxx/libswocxx.h
+++ b/bindings/cxx/include/libswocxx/libswocxx.hpp
@@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef LIBSWOCXX_H
-#define LIBSWOCXX_H
+#ifndef LIBSWOCXX_HPP
+#define LIBSWOCXX_HPP
#include <stdint.h>
#include <string>
@@ -31,8 +31,6 @@
namespace libswo
{
-using namespace std;
-
enum class LogLevel {
NONE = LIBSWO_LOG_LEVEL_NONE,
ERROR = LIBSWO_LOG_LEVEL_ERROR,
@@ -44,7 +42,7 @@ enum class LogLevel {
enum class PacketType {
UNKNOWN = LIBSWO_PACKET_TYPE_UNKNOWN,
SYNC = LIBSWO_PACKET_TYPE_SYNC,
- OF = LIBSWO_PACKET_TYPE_OVERFLOW,
+ OF = LIBSWO_PACKET_TYPE_OF,
LTS = LIBSWO_PACKET_TYPE_LTS,
GTS1 = LIBSWO_PACKET_TYPE_GTS1,
GTS2 = LIBSWO_PACKET_TYPE_GTS2,
@@ -52,7 +50,7 @@ enum class PacketType {
INST = LIBSWO_PACKET_TYPE_INST,
HW = LIBSWO_PACKET_TYPE_HW,
DWT_EVTCNT = LIBSWO_PACKET_TYPE_DWT_EVTCNT,
- DWT_EXCTRACE = LIBSWO_PACKET_TYPE_DWT_EXCTRACE,
+ DWT_EXCTRC = LIBSWO_PACKET_TYPE_DWT_EXCTRC,
DWT_PC_SAMPLE = LIBSWO_PACKET_TYPE_DWT_PC_SAMPLE,
DWT_PC_VALUE = LIBSWO_PACKET_TYPE_DWT_PC_VALUE,
DWT_ADDR_OFFSET = LIBSWO_PACKET_TYPE_DWT_ADDR_OFFSET,
@@ -72,10 +70,10 @@ enum class ExtensionSource {
};
enum class ExceptionTraceFunction {
- RESERVED = LIBSWO_EXCTRACE_FUNC_RESERVED,
- ENTER = LIBSWO_EXCTRACE_FUNC_ENTER,
- EXIT = LIBSWO_EXCTRACE_FUNC_EXIT,
- RETURN = LIBSWO_EXCTRACE_FUNC_RETURN
+ RESERVED = LIBSWO_EXCTRC_FUNC_RESERVED,
+ ENTER = LIBSWO_EXCTRC_FUNC_ENTER,
+ EXIT = LIBSWO_EXCTRC_FUNC_EXIT,
+ RETURN = LIBSWO_EXCTRC_FUNC_RETURN
};
enum class DecoderFlags {
@@ -89,7 +87,7 @@ const unsigned int LOG_DOMAIN_MAX_LENGTH = LIBSWO_LOG_DOMAIN_MAX_LENGTH;
typedef int (*LogCallback)(LogLevel level, const std::string &message,
void *user_data);
-class LIBSWO_API Error : public exception
+class LIBSWO_API Error : public std::exception
{
public:
Error(int error_code);
@@ -106,7 +104,7 @@ public:
PacketType get_type(void) const;
size_t get_size(void) const;
- virtual const string to_string(void) const = 0;
+ virtual const std::string to_string(void) const = 0;
protected:
union libswo_packet _packet;
};
@@ -118,7 +116,7 @@ class LIBSWO_API PayloadPacket : public Packet
public:
virtual ~PayloadPacket(void) = 0;
- const vector<uint8_t> get_data(void) const;
+ const std::vector<uint8_t> get_data(void) const;
static const unsigned int MAX_SIZE = LIBSWO_MAX_PAYLOAD_SIZE;
};
@@ -129,7 +127,7 @@ public:
Unknown(const struct libswo_packet_unknown *packet);
Unknown(const union libswo_packet *packet);
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API Synchronization : public Packet
@@ -138,7 +136,7 @@ public:
Synchronization(const struct libswo_packet_sync *packet);
Synchronization(const union libswo_packet *packet);
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API Overflow : public PayloadPacket
@@ -147,7 +145,7 @@ public:
Overflow(const struct libswo_packet_of *packet);
Overflow(const union libswo_packet *packet);
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API LocalTimestamp : public PayloadPacket
@@ -159,7 +157,7 @@ public:
LocalTimestampRelation get_relation() const;
uint32_t get_value(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API GlobalTimestamp1 : public PayloadPacket
@@ -172,7 +170,7 @@ public:
bool get_clkch(void) const;
bool get_wrap(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API GlobalTimestamp2 : public PayloadPacket
@@ -183,7 +181,7 @@ public:
uint32_t get_value(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API Extension : public PayloadPacket
@@ -195,7 +193,7 @@ public:
ExtensionSource get_source(void) const;
uint32_t get_value(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API SourcePacket : public PayloadPacket
@@ -204,10 +202,10 @@ public:
virtual ~SourcePacket(void);
uint8_t get_address(void) const;
- const vector<uint8_t> get_payload(void) const;
+ const std::vector<uint8_t> get_payload(void) const;
uint32_t get_value(void) const;
- virtual const string to_string(void) const = 0;
+ virtual const std::string to_string(void) const = 0;
static const unsigned int MAX_ADDRESS = LIBSWO_MAX_SOURCE_ADDRESS;
};
@@ -218,7 +216,7 @@ public:
Instrumentation(const struct libswo_packet_inst *packet);
Instrumentation(const union libswo_packet *packet);
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API Hardware : public SourcePacket
@@ -227,7 +225,7 @@ public:
Hardware(const struct libswo_packet_hw *packet);
Hardware(const union libswo_packet *packet);
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API EventCounter : public Hardware
@@ -243,19 +241,19 @@ public:
bool get_fold(void) const;
bool get_cyc(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API ExceptionTrace : public Hardware
{
public:
- ExceptionTrace(const struct libswo_packet_dwt_exctrace *packet);
+ ExceptionTrace(const struct libswo_packet_dwt_exctrc *packet);
ExceptionTrace(const union libswo_packet *packet);
uint16_t get_exception(void) const;
ExceptionTraceFunction get_function(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API PCSample : public Hardware
@@ -267,7 +265,7 @@ public:
bool get_sleep(void) const;
uint32_t get_pc(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API PCValue : public Hardware
@@ -279,7 +277,7 @@ public:
uint8_t get_comparator(void) const;
uint32_t get_pc(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API AddressOffset : public Hardware
@@ -291,7 +289,7 @@ public:
uint8_t get_comparator(void) const;
uint16_t get_offset(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_API DataValue : public Hardware
@@ -304,7 +302,7 @@ public:
uint8_t get_comparator(void) const;
uint32_t get_data_value(void) const;
- const string to_string(void) const;
+ const std::string to_string(void) const;
};
class LIBSWO_PRIV DecoderCallbackHelper
@@ -331,8 +329,8 @@ public:
LogLevel get_log_level(void) const;
void set_log_level(LogLevel level);
- string get_log_domain(void) const;
- void set_log_domain(const string &domain);
+ std::string get_log_domain(void) const;
+ void set_log_domain(const std::string &domain);
void set_log_callback(LogCallback callback, void *user_data = NULL);
void set_callback(DecoderCallback callback, void *user_data = NULL);
@@ -353,12 +351,12 @@ public:
static int get_package_major(void);
static int get_package_minor(void);
static int get_package_micro(void);
- static string get_package_string(void);
+ static std::string get_package_string(void);
static int get_library_current(void);
static int get_library_revision(void);
static int get_library_age(void);
- static string get_library_string(void);
+ static std::string get_library_string(void);
};
inline DecoderFlags operator|(DecoderFlags lhs, DecoderFlags rhs)
@@ -371,4 +369,4 @@ inline DecoderFlags operator|(DecoderFlags lhs, DecoderFlags rhs)
}
-#endif /* LIBSWOCXX_H */
+#endif /* LIBSWOCXX_HPP */
diff --git a/bindings/cxx/instrumentation.cpp b/bindings/cxx/instrumentation.cpp
index b391e50..f4783c0 100644
--- a/bindings/cxx/instrumentation.cpp
+++ b/bindings/cxx/instrumentation.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/localtimestamp.cpp b/bindings/cxx/localtimestamp.cpp
index 3d52cf6..a2554d8 100644
--- a/bindings/cxx/localtimestamp.cpp
+++ b/bindings/cxx/localtimestamp.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/overflow.cpp b/bindings/cxx/overflow.cpp
index 0b2b514..5225a87 100644
--- a/bindings/cxx/overflow.cpp
+++ b/bindings/cxx/overflow.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/packet.cpp b/bindings/cxx/packet.cpp
index 814377c..b92f6d9 100644
--- a/bindings/cxx/packet.cpp
+++ b/bindings/cxx/packet.cpp
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/payloadpacket.cpp b/bindings/cxx/payloadpacket.cpp
index 7f3c68a..c0cb9cf 100644
--- a/bindings/cxx/payloadpacket.cpp
+++ b/bindings/cxx/payloadpacket.cpp
@@ -19,7 +19,7 @@
#include <vector>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
@@ -28,9 +28,9 @@ PayloadPacket::~PayloadPacket(void)
{
}
-const vector<uint8_t> PayloadPacket::get_data(void) const
+const std::vector<uint8_t> PayloadPacket::get_data(void) const
{
- return vector<uint8_t>(_packet.any.data,
+ return std::vector<uint8_t>(_packet.any.data,
_packet.any.data + _packet.any.size);
}
diff --git a/bindings/cxx/pcsample.cpp b/bindings/cxx/pcsample.cpp
index e21cfaf..173c7b9 100644
--- a/bindings/cxx/pcsample.cpp
+++ b/bindings/cxx/pcsample.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/pcvalue.cpp b/bindings/cxx/pcvalue.cpp
index 6f5cfd2..35035df 100644
--- a/bindings/cxx/pcvalue.cpp
+++ b/bindings/cxx/pcvalue.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/sourcepacket.cpp b/bindings/cxx/sourcepacket.cpp
index 734f163..fcd57aa 100644
--- a/bindings/cxx/sourcepacket.cpp
+++ b/bindings/cxx/sourcepacket.cpp
@@ -19,7 +19,7 @@
#include <vector>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
@@ -33,9 +33,9 @@ uint8_t SourcePacket::get_address(void) const
return _packet.inst.address;
}
-const vector<uint8_t> SourcePacket::get_payload(void) const
+const std::vector<uint8_t> SourcePacket::get_payload(void) const
{
- return vector<uint8_t>(_packet.inst.payload,
+ return std::vector<uint8_t>(_packet.inst.payload,
_packet.inst.payload + _packet.inst.size - 1);
}
diff --git a/bindings/cxx/synchronization.cpp b/bindings/cxx/synchronization.cpp
index d1bca37..8a02119 100644
--- a/bindings/cxx/synchronization.cpp
+++ b/bindings/cxx/synchronization.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/unknown.cpp b/bindings/cxx/unknown.cpp
index fd997e7..780a531 100644
--- a/bindings/cxx/unknown.cpp
+++ b/bindings/cxx/unknown.cpp
@@ -19,7 +19,7 @@
#include <sstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
diff --git a/bindings/cxx/version.cpp b/bindings/cxx/version.cpp
index 08f5c8f..7bb9e1c 100644
--- a/bindings/cxx/version.cpp
+++ b/bindings/cxx/version.cpp
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
namespace libswo
{
@@ -37,7 +37,7 @@ int Version::get_package_micro(void)
return libswo_version_package_get_micro();
}
-string Version::get_package_string(void)
+std::string Version::get_package_string(void)
{
return libswo_version_package_get_string();
}
@@ -57,7 +57,7 @@ int Version::get_library_age(void)
return libswo_version_library_get_age();
}
-string Version::get_library_string(void)
+std::string Version::get_library_string(void)
{
return libswo_version_library_get_string();
}
diff --git a/bindings/python/Context.h b/bindings/python/Context.h
index 0714e9c..820bb7d 100644
--- a/bindings/python/Context.h
+++ b/bindings/python/Context.h
@@ -20,7 +20,7 @@
#ifndef LIBSWO_BINDINGS_PYTHON_CONTEXT_H
#define LIBSWO_BINDINGS_PYTHON_CONTEXT_H
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
class Context : public libswo::Context
{
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 7aa683a..b134ad1 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -20,7 +20,9 @@
CXX_SRCDIR = $(top_srcdir)/bindings/cxx
CXX_BUILDDIR = $(top_builddir)/bindings/cxx
-EXTRA_DIST = swopy.i __init__.py Context.h
+PYTHON_SRCDIR = $(top_srcdir)/bindings/python
+
+EXTRA_DIST = swopy.i enums.py __init__.py Context.h
all-local: swopy build-lock
@@ -31,9 +33,10 @@ swopy:
# Use empty target build-lock to ensure that the Python module is built only if
# one of its source files has changed since the last invocation.
-build-lock: setup.py $(srcdir)/swopy.i Context.h $(CXX_BUILDDIR)/libswocxx.la
+build-lock: setup.py $(srcdir)/swopy.i enums.py Context.h \
+ $(CXX_BUILDDIR)/libswocxx.la
$(SWIG) -python -c++ -Wall -outdir swopy -outcurrentdir \
- -I$(CXX_SRCDIR)/include $(srcdir)/swopy.i
+ -I$(CXX_SRCDIR)/include -I$(PYTHON_SRCDIR) $(srcdir)/swopy.i
$(PYTHON) setup.py --quiet build
touch build-lock
diff --git a/bindings/python/enums.py b/bindings/python/enums.py
new file mode 100644
index 0000000..eab033b
--- /dev/null
+++ b/bindings/python/enums.py
@@ -0,0 +1,62 @@
+##
+## This file is part of the libswo project.
+##
+## Copyright (C) 2017 Marc Schink <swo-dev@marcschink.de>
+##
+## This program is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program. If not, see <http://www.gnu.org/licenses/>.
+##
+
+class LogLevel:
+ NONE = 0
+ ERROR = 1
+ WARNING = 2
+ INFO = 3
+ DEBUG = 4
+
+class PacketType:
+ UNKNOWN = 0
+ SYNC = 1
+ OF = 2
+ LTS = 3
+ GTS1 = 4
+ GTS2 = 5
+ EXT = 6
+ INST = 7
+ HW = 8
+ DWT_EVTCNT = 16
+ DWT_EXCTRC = 17
+ DWT_PC_SAMPLE = 18
+ DWT_PC_VALUE = 19
+ DWT_ADDR_OFFSET = 20
+ DWT_DATA_VALUE = 21
+
+class LocalTimestampRelation:
+ SYNC = 0
+ TS = 1
+ SRC = 2
+ BOTH = 3
+
+class ExtensionSource:
+ ITM = 0
+ HW = 1
+
+class ExceptionTraceFunction:
+ RESERVED = 0
+ ENTER = 1
+ EXIT = 2
+ RETURN = 3
+
+class DecoderFlags:
+ NONE = 0
+ EOS = (1 << 0)
diff --git a/bindings/python/swopy.i b/bindings/python/swopy.i
index 89124a1..eaa38be 100644
--- a/bindings/python/swopy.i
+++ b/bindings/python/swopy.i
@@ -20,7 +20,7 @@
%module swopy
%{
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
%}
%include "stdint.i"
@@ -57,43 +57,14 @@ static int swig_exception_code(int code)
}
%}
-%rename(LOG_LEVEL_NONE) libswo::LogLevel::NONE;
-%rename(LOG_LEVEL_ERROR) libswo::LogLevel::ERROR;
-%rename(LOG_LEVEL_WARNING) libswo::LogLevel::WARNING;
-%rename(LOG_LEVEL_INFO) libswo::LogLevel::INFO;
-%rename(LOG_LEVEL_DEBUG) libswo::LogLevel::DEBUG;
-
-%rename(PACKET_TYPE_UNKNOWN) libswo::PacketType::UNKNOWN;
-%rename(PACKET_TYPE_SYNC) libswo::PacketType::SYNC;
-%rename(PACKET_TYPE_OF) libswo::PacketType::OF;
-%rename(PACKET_TYPE_LTS) libswo::PacketType::LTS;
-%rename(PACKET_TYPE_GTS1) libswo::PacketType::GTS1;
-%rename(PACKET_TYPE_GTS2) libswo::PacketType::GTS2;
-%rename(PACKET_TYPE_EXT) libswo::PacketType::EXT;
-%rename(PACKET_TYPE_INST) libswo::PacketType::INST;
-%rename(PACKET_TYPE_HW) libswo::PacketType::HW;
-%rename(PACKET_TYPE_DWT_EVTCNT) libswo::PacketType::DWT_EVTCNT;
-%rename(PACKET_TYPE_DWT_EXCTRACE) libswo::PacketType::DWT_EXCTRACE;
-%rename(PACKET_TYPE_DWT_PC_SAMPLE) libswo::PacketType::DWT_PC_SAMPLE;
-%rename(PACKET_TYPE_DWT_PC_VALUE) libswo::PacketType::DWT_PC_VALUE;
-%rename(PACKET_TYPE_DWT_ADDR_OFFSET) libswo::PacketType::DWT_ADDR_OFFSET;
-%rename(PACKET_TYPE_DWT_DATA_VALUE) libswo::PacketType::DWT_DATA_VALUE;
-
-%rename(LTS_REL_SYNC) libswo::LocalTimestampRelation::SYNC;
-%rename(LTS_REL_TS) libswo::LocalTimestampRelation::TS;
-%rename(LTS_REL_SRC) libswo::LocalTimestampRelation::SRC;
-%rename(LTS_REL_BOTH) libswo::LocalTimestampRelation::BOTH;
-
-%rename(EXT_SRC_ITM) libswo::ExtensionSource::ITM;
-%rename(EXT_SRC_HW) libswo::ExtensionSource::HW;
-
-%rename(EXCTRACE_FUNC_RESERVED) libswo::ExceptionTraceFunction::RESERVED;
-%rename(EXCTRACE_FUNC_ENTER) libswo::ExceptionTraceFunction::ENTER;
-%rename(EXCTRACE_FUNC_EXIT) libswo::ExceptionTraceFunction::EXIT;
-%rename(EXCTRACE_FUNC_RETURN) libswo::ExceptionTraceFunction::RETURN;
-
-%rename(DF_NONE) libswo::DecoderFlags::NONE;
-%rename(DF_EOS) libswo::DecoderFlags::EOS;
+%ignore libswo::LogLevel;
+%ignore libswo::PacketType;
+%ignore libswo::LocalTimestampRelation;
+%ignore libswo::ExtensionSource;
+%ignore libswo::ExceptionTraceFunction;
+%ignore libswo::DecoderFlags;
+
+%pythoncode "enums.py"
%rename(__str__) libswo::Packet::to_string;
@@ -240,7 +211,7 @@ static PyObject *packet_object(const libswo::Packet &packet)
ret = SWIG_NewPointerObj(tmp, SWIGTYPE_p_libswo__EventCounter,
0);
break;
- case libswo::PacketType::DWT_EXCTRACE:
+ case libswo::PacketType::DWT_EXCTRC:
ret = SWIG_NewPointerObj(tmp,
SWIGTYPE_p_libswo__ExceptionTrace, 0);
break;
@@ -328,5 +299,5 @@ void Context::set_callback(PyObject *callback)
#define LIBSWO_API
#define LIBSWO_PRIV
-%include <libswocxx/libswocxx.h>
+%include <libswocxx/libswocxx.hpp>
%include "Context.h"
diff --git a/configure.ac b/configure.ac
index 72e87a8..0cf25db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@
AC_PREREQ([2.69])
-AC_INIT([libswo], [0.1.0], [swo-dev@marcschink.de], [libswo],
+AC_INIT([libswo], [0.2.0], [swo-dev@marcschink.de], [libswo],
[http://git.zapb.de/libswo.git])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/examples/decoder.cpp b/examples/decoder.cpp
index 556f930..1d29389 100644
--- a/examples/decoder.cpp
+++ b/examples/decoder.cpp
@@ -22,7 +22,7 @@
#include <iostream>
#include <fstream>
-#include <libswocxx/libswocxx.h>
+#include <libswocxx/libswocxx.hpp>
#define BUFFER_SIZE 1024
@@ -121,7 +121,7 @@ static void handle_evtcnt_packet(const EventCounter &packet)
packet.get_cyc());
}
-static void handle_exctrace_packet(const ExceptionTrace &packet)
+static void handle_exctrc_packet(const ExceptionTrace &packet)
{
const char *function;
@@ -203,8 +203,8 @@ int packet_callback(const Packet &packet, void *user_data)
case PacketType::DWT_EVTCNT:
handle_evtcnt_packet(dynamic_cast<const EventCounter &>(packet));
break;
- case PacketType::DWT_EXCTRACE:
- handle_exctrace_packet(dynamic_cast<const ExceptionTrace &>(packet));
+ case PacketType::DWT_EXCTRC:
+ handle_exctrc_packet(dynamic_cast<const ExceptionTrace &>(packet));
break;
case PacketType::DWT_PC_SAMPLE:
handle_pc_sample_packet(dynamic_cast<const PCSample &>(packet));
diff --git a/examples/decoder.py b/examples/decoder.py
index bb359ed..2416a2e 100644
--- a/examples/decoder.py
+++ b/examples/decoder.py
@@ -32,7 +32,7 @@ class Decoder:
def feed(self, data):
self._ctx.feed(data)
- def decode(self, flags=swopy.DF_NONE):
+ def decode(self, flags=swopy.DecoderFlags.NONE):
self._ctx.decode(flags)
def _handle_unknown_packet(self, packet):
@@ -52,13 +52,13 @@ class Decoder:
def _handle_lts_packet(self, packet):
relation = packet.get_relation()
- if relation == swopy.LTS_REL_SYNC:
+ if relation == swopy.LocalTimestampRelation.SYNC:
tc = 'synchronous'
- elif relation == swopy.LTS_REL_TS:
+ elif relation == swopy.LocalTimestampRelation.TS:
tc = 'timestamp delayed'
- elif relation == swopy.LTS_REL_SRC:
+ elif relation == swopy.LocalTimestampRelation.SRC:
tc = 'data delayed'
- elif relation == swopy.LTS_REL_BOTH:
+ elif relation == swopy.LocalTimestampRelation.BOTH:
tc = 'data and timestamp delayed'
else:
return
@@ -74,9 +74,9 @@ class Decoder:
print('Global timestamp (GTS2) (value = %x)' % packet.get_value())
def _handle_ext_packet(self, packet):
- if packet.get_source() == swopy.EXT_SRC_ITM:
+ if packet.get_source() == swopy.ExtensionSource.ITM:
src = 'ITM'
- elif packet.get_source() == swopy.EXT_SRC_HW:
+ elif packet.get_source() == swopy.ExtensionSource.HW:
src = 'HW'
else:
print('Extension packet with invalid source: %u.' %
@@ -100,12 +100,12 @@ class Decoder:
packet.get_sleep(), packet.get_lsu(), packet.get_fold(),
packet.get_cyc()));
- def _handle_exctrace_packet(self, packet):
- if packet.get_function() == swopy.EXCTRACE_FUNC_ENTER:
+ def _handle_exctrc_packet(self, packet):
+ if packet.get_function() == swopy.ExceptionTraceFunction.ENTER:
func = 'enter'
- elif packet.get_function() == swopy.EXCTRACE_FUNC_EXIT:
+ elif packet.get_function() == swopy.ExceptionTraceFunction.EXIT:
func = 'exit'
- elif packet.get_function() == swopy.EXCTRACE_FUNC_RETURN:
+ elif packet.get_function() == swopy.ExceptionTraceFunction.RETURN:
func = 'return'
else:
func = 'reserved'
@@ -135,35 +135,35 @@ class Decoder:
def _packet_callback(self, packet):
packet_type = packet.get_type()
- if packet_type == swopy.PACKET_TYPE_UNKNOWN:
+ if packet_type == swopy.PacketType.UNKNOWN:
self._handle_unknown_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_SYNC:
+ elif packet_type == swopy.PacketType.SYNC:
self._handle_sync_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_OF:
+ elif packet_type == swopy.PacketType.OF:
self._handle_overflow_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_LTS:
+ elif packet_type == swopy.PacketType.LTS:
self._handle_lts_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_GTS1:
+ elif packet_type == swopy.PacketType.GTS1:
self._handle_gts1_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_GTS2:
+ elif packet_type == swopy.PacketType.GTS2:
self._handle_gts2_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_EXT:
+ elif packet_type == swopy.PacketType.EXT:
self._handle_ext_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_INST:
+ elif packet_type == swopy.PacketType.INST:
self._handle_inst_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_HW:
+ elif packet_type == swopy.PacketType.HW:
self._handle_hw_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_EVTCNT:
+ elif packet_type == swopy.PacketType.DWT_EVTCNT:
self._handle_evtcnt_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_EXCTRACE:
- self._handle_exctrace_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_PC_SAMPLE:
+ elif packet_type == swopy.PacketType.DWT_EXCTRC:
+ self._handle_exctrc_packet(packet)
+ elif packet_type == swopy.PacketType.DWT_PC_SAMPLE:
self._handle_pc_sample_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_PC_VALUE:
+ elif packet_type == swopy.PacketType.DWT_PC_VALUE:
self._handle_pc_value_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_ADDR_OFFSET:
+ elif packet_type == swopy.PacketType.DWT_ADDR_OFFSET:
self._handle_addr_offset_packet(packet)
- elif packet_type == swopy.PACKET_TYPE_DWT_DATA_VALUE:
+ elif packet_type == swopy.PacketType.DWT_DATA_VALUE:
self._handle_data_value_packet(packet)
else:
print('Unknown packet type %u' % packet_type, file=sys.stderr)
@@ -196,7 +196,7 @@ if __name__ == '__main__':
input_file.close()
try:
- decoder.decode(swopy.DF_EOS)
+ decoder.decode(swopy.DecoderFlags.EOS)
except Exception as e:
print(e, file=sys.stderr)
diff --git a/libswo/core.c b/libswo/core.c
index 75dd85c..34ff972 100644
--- a/libswo/core.c
+++ b/libswo/core.c
@@ -24,6 +24,39 @@
#include "libswo-internal.h"
/**
+ * @mainpage
+ *
+ * @section sec_intro Introduction
+ *
+ * This document describes the API of libswo.
+ *
+ * libswo is a shared library written in C to decode SWO trace data.
+ *
+ * @section sec_error Error handling
+ *
+ * The libswo functions which can fail use the return value to indicate an
+ * error. The functions typically return an error code of #libswo_error.
+ * For each function, all possible error codes and their detailed descriptions
+ * are documented. As the possible error codes returned by a function may
+ * change it is recommended to also always cover unexpected values when
+ * checking for error codes to be compatible with later versions of libswo.
+ *
+ * There are a few exceptions where a function directly returns the result
+ * instead of an error code because it is more convenient from an API
+ * perspective and because there is only a single reason for failure which is
+ * clearly distinguishable from the result.
+ *
+ * @section sec_license Copyright and license
+ *
+ * libswo is licensed under the terms of the GNU General Public License (GPL),
+ * version 3 or later.
+ *
+ * @section sec_website Website
+ *
+ * <a href="http://git.zapb.de/libswo.git">git.zapb.de/libswo.git</a>
+ */
+
+/**
* @file
*
* Core library functions.
diff --git a/libswo/decoder.c b/libswo/decoder.c
index dc2af25..9dd1ad9 100644
--- a/libswo/decoder.c
+++ b/libswo/decoder.c
@@ -118,7 +118,7 @@ static int decode_packet_type(uint8_t header)
return LIBSWO_PACKET_TYPE_SYNC;
if (header == OVERFLOW_HEADER)
- return LIBSWO_PACKET_TYPE_OVERFLOW;
+ return LIBSWO_PACKET_TYPE_OF;
if (!(header & ~LTS2_TS_MASK))
return LIBSWO_PACKET_TYPE_LTS;
@@ -238,7 +238,7 @@ static bool decode_sync_packet(struct libswo_context *ctx)
static bool decode_overflow_packet(struct libswo_context *ctx)
{
- ctx->packet.type = LIBSWO_PACKET_TYPE_OVERFLOW;
+ ctx->packet.type = LIBSWO_PACKET_TYPE_OF;
ctx->packet.of.size = 1;
log_dbg(ctx, "Overflow packet decoded.");
@@ -563,7 +563,7 @@ LIBSWO_API int libswo_decode(struct libswo_context *ctx, uint32_t flags)
case LIBSWO_PACKET_TYPE_SYNC:
ret = decode_sync_packet(ctx);
break;
- case LIBSWO_PACKET_TYPE_OVERFLOW:
+ case LIBSWO_PACKET_TYPE_OF:
ret = decode_overflow_packet(ctx);
break;
case LIBSWO_PACKET_TYPE_LTS:
diff --git a/libswo/dwt.c b/libswo/dwt.c
index 75c436e..bab984d 100644
--- a/libswo/dwt.c
+++ b/libswo/dwt.c
@@ -47,22 +47,22 @@
#define EVTCNT_CYC_MASK 0x20
/* Exception trace packet discriminator ID. */
-#define EXCTRACE_ID 1
+#define EXCTRC_ID 1
/* Size of an exception trace packet in bytes. */
-#define EXCTRACE_SIZE 3
+#define EXCTRC_SIZE 3
/* Bitmask for the exception number of an exception trace packet. */
-#define EXCTRACE_EX_MASK 0x01
+#define EXCTRC_EX_MASK 0x01
/* Offset of the exception number of an exception trace packet. */
-#define EXCTRACE_EX_OFFSET 8
+#define EXCTRC_EX_OFFSET 8
/* Bitmask for the function of an exception trace packet. */
-#define EXCTRACE_FN_MASK 0x30
+#define EXCTRC_FN_MASK 0x30
/* Offset of the function of an exception trace packet. */
-#define EXCTRACE_FN_OFFSET 4
+#define EXCTRC_FN_OFFSET 4
/* Periodic PC sample packet discriminator ID. */
#define PC_SAMPLE_ID 2
@@ -130,27 +130,27 @@ static bool decode_evtcnt_packet(struct libswo_context *ctx,
return true;
}
-static bool decode_exctrace_packet(struct libswo_context *ctx,
+static bool decode_exctrc_packet(struct libswo_context *ctx,
const struct libswo_packet_hw *hw)
{
uint16_t exception;
uint8_t tmp;
- if (hw->size != EXCTRACE_SIZE) {
+ if (hw->size != EXCTRC_SIZE) {
log_warn(ctx, "Exception trace packet with invalid size of "
"%zu bytes.", hw->size);
return false;
}
ctx->packet.hw = *hw;
- ctx->packet.type = LIBSWO_PACKET_TYPE_DWT_EXCTRACE;
+ ctx->packet.type = LIBSWO_PACKET_TYPE_DWT_EXCTRC;
exception = hw->payload[0];
- exception |= (hw->payload[1] & EXCTRACE_EX_MASK) << EXCTRACE_EX_OFFSET;
- tmp = (hw->payload[1] & EXCTRACE_FN_MASK) >> EXCTRACE_FN_OFFSET;
+ exception |= (hw->payload[1] & EXCTRC_EX_MASK) << EXCTRC_EX_OFFSET;
+ tmp = (hw->payload[1] & EXCTRC_FN_MASK) >> EXCTRC_FN_OFFSET;
- ctx->packet.exctrace.exception = exception;
- ctx->packet.exctrace.function = tmp;
+ ctx->packet.exctrc.exception = exception;
+ ctx->packet.exctrc.function = tmp;
log_dbg(ctx, "Exception trace packet decoded.");
@@ -256,8 +256,8 @@ LIBSWO_PRIV bool dwt_decode_packet(struct libswo_context *ctx,
{
if (hw->address == EVTCNT_ID)
return decode_evtcnt_packet(ctx, hw);
- else if (hw->address == EXCTRACE_ID)
- return decode_exctrace_packet(ctx, hw);
+ else if (hw->address == EXCTRC_ID)
+ return decode_exctrc_packet(ctx, hw);
else if (hw->address == PC_SAMPLE_ID)
return decode_pc_sample_packet(ctx, hw);
else if ((hw->address & PC_VALUE_HEADER_MASK) == PC_VALUE_HEADER)
diff --git a/libswo/libswo.h b/libswo/libswo.h
index 3488f60..d83be2f 100644
--- a/libswo/libswo.h
+++ b/libswo/libswo.h
@@ -76,7 +76,7 @@ enum libswo_packet_type {
/** Synchronization packet. */
LIBSWO_PACKET_TYPE_SYNC = 1,
/** Overflow packet. */
- LIBSWO_PACKET_TYPE_OVERFLOW = 2,
+ LIBSWO_PACKET_TYPE_OF = 2,
/** Local timestamp packet. */
LIBSWO_PACKET_TYPE_LTS = 3,
/** Global timestamp (GTS1) packet. */
@@ -92,7 +92,7 @@ enum libswo_packet_type {
/** DWT: Event counter packet. */
LIBSWO_PACKET_TYPE_DWT_EVTCNT = 16,
/** DWT: Exception trace packet. */
- LIBSWO_PACKET_TYPE_DWT_EXCTRACE = 17,
+ LIBSWO_PACKET_TYPE_DWT_EXCTRC = 17,
/** DWT: Periodic PC sample packet. */
LIBSWO_PACKET_TYPE_DWT_PC_SAMPLE = 18,
/** DWT: Data trace PC value packet. */
@@ -135,15 +135,15 @@ enum libswo_decoder_flags {
};
/** Exception trace functions. */
-enum libswo_exctrace_function {
+enum libswo_exctrc_function {
/** Reserved. */
- LIBSWO_EXCTRACE_FUNC_RESERVED = 0,
+ LIBSWO_EXCTRC_FUNC_RESERVED = 0,
/** Enter exception. */
- LIBSWO_EXCTRACE_FUNC_ENTER = 1,
+ LIBSWO_EXCTRC_FUNC_ENTER = 1,
/** Exit exception. */
- LIBSWO_EXCTRACE_FUNC_EXIT = 2,
+ LIBSWO_EXCTRC_FUNC_EXIT = 2,
/** Return to exception. */
- LIBSWO_EXCTRACE_FUNC_RETURN = 3
+ LIBSWO_EXCTRC_FUNC_RETURN = 3
};
/** Maximum payload size of a packet in bytes. */
@@ -338,7 +338,7 @@ struct libswo_packet_dwt_evtcnt {
};
/** DWT: Exception trace packet. */
-struct libswo_packet_dwt_exctrace {
+struct libswo_packet_dwt_exctrc {
/** Packet type. */
enum libswo_packet_type type;
/** Packet size including the header in bytes. */
@@ -354,7 +354,7 @@ struct libswo_packet_dwt_exctrace {
/** Exception number. */
uint16_t exception;
/** Action taken by the processor. */
- enum libswo_exctrace_function function;
+ enum libswo_exctrc_function function;
};
/** DWT: Periodic PC sample packet. */
@@ -470,7 +470,7 @@ union libswo_packet {
/** DWT: Event counter packet. */
struct libswo_packet_dwt_evtcnt evtcnt;
/** DWT: Exception trace packet. */
- struct libswo_packet_dwt_exctrace exctrace;
+ struct libswo_packet_dwt_exctrc exctrc;
/** DWT: Periodic PC sample packet. */
struct libswo_packet_dwt_pc_sample pc_sample;
/** DWT: Data trace PC value packet. */