Skip to content
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

[PATCH v8] api: init: add odp_log_fn_get() and odp_abort_fn_get() #2126

Merged
merged 11 commits into from
Dec 20, 2024

Conversation

JereLeppanen
Copy link
Collaborator

No description provided.

@odpbuild odpbuild changed the title api: init: add odp_log_get_fn() function [PATCH v1] api: init: add odp_log_get_fn() function Sep 25, 2024
@odpbuild odpbuild changed the title [PATCH v1] api: init: add odp_log_get_fn() function [PATCH v2] api: init: add odp_log_get_fn() function Oct 16, 2024
@JereLeppanen JereLeppanen changed the title [PATCH v2] api: init: add odp_log_get_fn() function [PATCH v2] api: init: add odp_log_fn_get() and odp_abort_fn_get() Oct 16, 2024
@JereLeppanen
Copy link
Collaborator Author

v2:

  • Small cleanups.
  • Add odp_abort_fn_get().

@JereLeppanen JereLeppanen marked this pull request as ready for review October 16, 2024 14:31
include/odp/api/spec/init.h Outdated Show resolved Hide resolved
test/validation/api/init/init_main.c Show resolved Hide resolved
platform/linux-generic/odp_init.c Outdated Show resolved Hide resolved
@odpbuild odpbuild changed the title [PATCH v2] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v3] api: init: add odp_log_fn_get() and odp_abort_fn_get() Nov 21, 2024
@odpbuild odpbuild changed the title [PATCH v3] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v4] api: init: add odp_log_fn_get() and odp_abort_fn_get() Dec 3, 2024
@odpbuild odpbuild changed the title [PATCH v4] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v5] api: init: add odp_log_fn_get() and odp_abort_fn_get() Dec 3, 2024
Copy link
Collaborator

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor tweaks. Same comments for log and abort functions when applicable.

include/odp/api/spec/init.h Show resolved Hide resolved
include/odp/api/spec/init.h Show resolved Hide resolved
include/odp/api/spec/init.h Outdated Show resolved Hide resolved
test/validation/api/init/init_main.c Outdated Show resolved Hide resolved
helper/include/odp/helper/debug.h Show resolved Hide resolved
helper/include/odp/helper/debug.h Show resolved Hide resolved
@MatiasElo MatiasElo added the API next API change for next release label Dec 5, 2024
@MatiasElo MatiasElo added this to the v1.46.0.0 release milestone Dec 5, 2024
@odpbuild odpbuild changed the title [PATCH v5] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v6] api: init: add odp_log_fn_get() and odp_abort_fn_get() Dec 12, 2024
@JereLeppanen
Copy link
Collaborator Author

All comments processed in v6.

Copy link
Collaborator

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first commit should disappear after a rebase and one minor comment but looks good otherwise.

/* Default log function is not NULL. */
odp_log_func_t log_fn_def = odp_log_fn_get();

CU_ASSERT(log_fn_def != NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can now be fatal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v7.

@odpbuild odpbuild changed the title [PATCH v6] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v7] api: init: add odp_log_fn_get() and odp_abort_fn_get() Dec 17, 2024
@JereLeppanen
Copy link
Collaborator Author

Added review tags in v7.

Copy link
Collaborator

@psavol psavol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved all three API commits.

@odpbuild odpbuild changed the title [PATCH v7] api: init: add odp_log_fn_get() and odp_abort_fn_get() [PATCH v8] api: init: add odp_log_fn_get() and odp_abort_fn_get() Dec 20, 2024
@JereLeppanen
Copy link
Collaborator Author

v8:

  • Rebase.
  • Add review tags (Petri).

Add printf format check to odp_override_log() and odp_log_func_t
declarations. If the application calls these functions, the arguments
will be type-checked against the format string.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Add odp_log_fn_get() function, which returns the current log function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Add odp_abort_fn_get() function, which returns the abort function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
ODPH_LOG, when called with ODPH_LOG_ABORT level, does exactly the same
thing as ODPH_ASSERT. Implement ODPH_ASSERT as a call to ODPH_LOG.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Implement new odp_log_fn_get() API function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Use the log function returned by odp_log_fn_get(). This means that
also helper logs go to the ODP log function, instead of being written
directly to stderr.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Test that odp_log_fn_get() API function returns the currently set log
function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Implement new odp_abort_fn_get() API function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Use the abort function returned by odp_abort_fn_get().

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Test that odp_abort_fn_get() API function returns the currently set
abort function.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Add a few details to the documentation of debug macros.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
@MatiasElo MatiasElo added the API Ready API change ready to be merged (with the next API version increment) label Dec 20, 2024
@MatiasElo MatiasElo enabled auto-merge (rebase) December 20, 2024 08:11
@MatiasElo MatiasElo merged commit 9c84898 into OpenDataPlane:master Dec 20, 2024
160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API next API change for next release API Ready API change ready to be merged (with the next API version increment)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants