-
Notifications
You must be signed in to change notification settings - Fork 3
[TIOVX-1501] Implementing node/graph level debug options #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,8 @@ | |
#define TIVX_DEBUG_H | ||
|
||
#include <stdbool.h> | ||
#include <VX/vx.h> | ||
|
||
/*! \brief Macros for build time check | ||
* \ingroup group_tivx_platform | ||
*/ | ||
|
@@ -74,6 +76,8 @@ | |
#define BUILD_ASSERT(e) \ | ||
enum { ASSERT_CONCAT(assert_line_, __LINE__) = (1U/(e)) } | ||
|
||
#define ZONE_BIT(zone) ((vx_uint32)1U << (zone)) | ||
|
||
/*! | ||
* \file | ||
* \brief The Internal Debugging API | ||
|
@@ -110,28 +114,39 @@ enum tivx_debug_zone_e { | |
|
||
VX_ZONE_OPTIMIZATION = 19, /*!< Used to provide optimization tips */ | ||
|
||
VX_ZONE_MAX = 32 | ||
VX_ZONE_MAX = 32 /*!< Maximum value a debug zone can be mapped to */ | ||
}; | ||
|
||
#define VX_PRINT(zone, message, ...) do { tivx_print(((vx_enum)zone), "[%s:%u] " message, __FUNCTION__, __LINE__, ## __VA_ARGS__); } while (1 == 0) | ||
|
||
/*! \def VX_PRINT | ||
* \brief The OpenVX Debugging Facility. | ||
* \brief Utility macro to print debug information if specified zone is globally set | ||
* \ingroup group_vx_debug | ||
*/ | ||
#define VX_PRINT(zone, message, ...) do { tivx_print_global(((vx_enum)zone), "[%s:%u] " message, __FUNCTION__, __LINE__, ## __VA_ARGS__); } while (1 == 0) | ||
|
||
#define VX_PRINT_LOCAL(zone, debug_zonemask, message, ...) do { tivx_print_object(((vx_enum)zone), debug_zonemask, "[%s:%u] " message, __FUNCTION__, __LINE__, ## __VA_ARGS__); } while (1 == 0) | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/*! \brief Internal Printing Function. | ||
* \param [in] zone The debug zone from \ref tivx_debug_zone_e. | ||
vx_char *tivx_find_zone_name(vx_enum zone); | ||
|
||
/*! \brief Internal printing function for the global debug zone bitmask | ||
* \param [in] zone The debug zone from \ref tivx_debug_zone_e required to print the given message. | ||
* \param [in] format The format string to print. | ||
* \param [in] ... The variable list of arguments. | ||
* \ingroup group_vx_debug | ||
*/ | ||
void tivx_print_global(vx_enum zone, const char *format, ...); | ||
|
||
/*! \brief Internal printing function for a framework object with a set debug zone bitmask | ||
* \param [in] zone The debug zone from \ref tivx_debug_zone_e required to print the given message. | ||
* \param [in] set_zone The debug zone bitmask of a framework object | ||
* \param [in] format The format string to print. | ||
* \param [in] ... The variable list of arguments. | ||
* \ingroup group_vx_debug | ||
*/ | ||
void tivx_print(vx_enum zone, const char *format, ...); | ||
void tivx_print_object(vx_enum zone, vx_uint32 debug_zonemask, const char *format, ...); | ||
|
||
/*! \brief Sets a zone bit in the debug mask | ||
* \param [in] zone The debug zone from \ref tivx_debug_zone_e. | ||
|
@@ -149,7 +164,35 @@ void tivx_clr_debug_zone(vx_enum zone); | |
* \param [in] zone The debug zone from \ref tivx_debug_zone_e. | ||
* \ingroup group_vx_debug | ||
*/ | ||
vx_bool tivx_get_debug_zone(vx_enum zone); | ||
vx_bool tivx_is_zone_enabled(vx_enum zone); | ||
|
||
/*! \brief Returns the global debug zone bitmask | ||
* \param [out] vx_uint32 The global debug zone bitmask | ||
* \ingroup group_vx_debug | ||
*/ | ||
vx_uint32 tivx_get_global_zonemask(void); | ||
|
||
/*! | ||
* \brief Sets or clears a given debug zone for a graph | ||
* | ||
* \param [in] graph Graph reference | ||
* \param [in] debug_zone Given debug zone enumeration | ||
* \param [in] enable Flag to indicate if zone should be enabled or disabled | ||
* | ||
* \ingroup group_vx_graph | ||
*/ | ||
vx_status tivxGraphSetDebugZone(vx_graph graph, vx_uint32 debug_zone, vx_bool enable); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I would like to consider the integration with our runtime debug configuration infrastructure. We use DLT Viewer (Diagnosis and Logging Tool Viewer, https://github.com/COVESA/dlt-viewer) The tivxGraphSetDebugZone() and tivxNodeSetDebugZone() look acceptable to use with the DLT Viewer. For the runtime configuration we need the list of the created OVX objects like graphs and nodes. DLT Viewer is usually started after the OVX executable is running. Problem: how can we control debug zone at runtime to debug Graph verify? Another integration level would be to have DLT Context feature There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new APIs can be called at any time, including after the graph verify phase. Therefore, changes can be made to the levels of specific nodes and graphs even at runtime. As far as DLT viewer integration goes with graph/node callbacks, we have filed tasks to explore DLT in greater depth in the next release. After doing so, we will be able to better address this point and work with you to understand this issue. |
||
|
||
/*! | ||
* \brief Sets or clears a given debug zone for a node | ||
* | ||
* \param [in] node Node reference | ||
* \param [in] debug_zone Given debug zone enumeration | ||
* \param [in] enable Flag to indicate if zone should be enabled or disabled | ||
* | ||
* \ingroup group_vx_node | ||
*/ | ||
vx_status tivxNodeSetDebugZone(vx_node node, vx_uint32 debug_zone, vx_bool enable); | ||
|
||
#ifdef __cplusplus | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal: change to
#define VX_PRINT_LOCAL(zone, object, message, ...) do { tivx_print_object(((vx_enum)zone), object->debug_zonemask, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with proposal, adding to implementation