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

[bugfix] Modify dlog output code #191

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

songgot
Copy link
Contributor

@songgot songgot commented Oct 18, 2023

When outputting dlog using dlogutil in Tizen, garbage values are output in the format starting with %

@taos-ci
Copy link
Collaborator

taos-ci commented Oct 18, 2023

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #191. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/.

@taos-ci
Copy link
Collaborator

taos-ci commented Oct 18, 2023

:octocat: cibot: @songgot, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nnstreamer-edge/ci/repo-workers/pr-checker/191-202310181422380.47395205497742-d1ee31d0e679a1c478a49fdec65d8ddb30dca408/.

@songgot songgot force-pushed the fix_dlog branch 2 times, most recently from 60ef94d to 41c4382 Compare October 18, 2023 07:07
Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@@ -14,6 +14,7 @@
#define __NNSTREAMER_EDGE_AITT_H__

#include "nnstreamer-edge.h"
#include "nnstreamer-edge-log.h"
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any symbols defined in nnstreamer-edge-log.h in this header file.

If there are .c files using nnstreamer-edge-log.h symbols, add include in .c files, not in .h file.

Copy link
Contributor Author

@songgot songgot Oct 23, 2023

Choose a reason for hiding this comment

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

Thank you.
#include <aitt_c.h>, line 26 in this file
The two values below must be redefined and used. This value is defined in <dlog.h> in nnstreamer-edge-log.h.

[   41s] In file included from /usr/include/aitt/aitt_c.h:24,
[   41s]                  from /home/abuild/rpmbuild/BUILD/nnstreamer-edge-0.2.5/src/libnnstreamer-edge/nnstreamer-edge-aitt.h:25,
[   41s]                  from /home/abuild/rpmbuild/BUILD/nnstreamer-edge-0.2.5/src/libnnstreamer-edge/nnstreamer-edge-aitt.c:19:
[   41s] /usr/include/aitt/AittTypes.h:71:26: error: expected identifier before numeric constant
[   41s]    71 | #define TIZEN_ERROR_NONE 0
[   41s]       |                          ^
[   41s] In file included from /home/abuild/rpmbuild/BUILD/nnstreamer-edge-0.2.5/src/libnnstreamer-edge/nnstreamer-edge-log.h:26,
[   41s]                  from /home/abuild/rpmbuild/BUILD/nnstreamer-edge-0.2.5/src/libnnstreamer-edge/nnstreamer-edge-aitt.c:23:
[   41s] /usr/include/dlog/dlog.h:72:29: error: 'TIZEN_ERROR_NOT_PERMITTED' undeclared here (not in a function); did you mean 'TIZEN_ERROR_NOT_SUPPORTED'?
[   41s]    72 |  DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */
[   41s]       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~
[   41s]       |                             TIZEN_ERROR_NOT_SUPPORTED
[   41s] make[2]: *** [src/CMakeFiles/nnstreamer-edge.dir/build.make:191: src/CMakeFiles/nnstreamer-edge.dir/libnnstreamer-edge/nnstreamer-edge-aitt.c.o] Error 1

Copy link
Member

Choose a reason for hiding this comment

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

Do you mean that there is a symbol in nnstreamer-edge-aitt.h that refers to aitt_c.h or not?

If yes: include aitt_c.h
If no: don't include aitt_c.h.

Or do you mean that there is a symbol in aitt_c.h that requires including another header before including aitt_c.h?

If yes: fix aitt_c.h or do workaround right before aitt_c.h with proper comments so that we can remove it later. And report to AITT or submit a PR to AITT to fix it.
If no: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The AITT representative asked me to use a pc file or add -DTIZEN. We are not using aitt pc in CMakeList.txt.
so I will add -DTIZEN

Copy link
Contributor Author

@songgot songgot Dec 4, 2023

Choose a reason for hiding this comment

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

@jaeyun-jung posted a related PR(#196). so I will remove -DTIZEN

Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@jaeyun-jung
Copy link
Collaborator

Suggestion: nns_edge_set_log_level() and nns_edge_log_level_e in nnstreamer-edge.h

When the macro for log message is moved to header (for tizen and android), set-log-level and the enumeration would be deleted because we cannot set the logging level.

I suggest deleting logging function in nnstreamer-edge.h, if this PR is necessary.

@songgot
Copy link
Contributor Author

songgot commented Nov 6, 2023

Okay, thank you.

Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@songgot
Copy link
Contributor Author

songgot commented Nov 10, 2023

Do you have any comments about this PR?

Comment on lines -492 to -495
* @brief Set the logging level. Default value is NNS_EDGE_LOG_INFO.
* @param[in] level The log level to print out.
*/
void nns_edge_set_log_level (nns_edge_log_level_e level);
Copy link
Member

Choose a reason for hiding this comment

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

Just remove this function? How can we set log level after this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Operation is possible without nns_edge_set_log_level().

@gichan-jang
Copy link
Member

To be honest, I don't know the intention of this change..
Can you give me brief explanation?

@@ -170,7 +169,7 @@ nns_edge_malloc (nns_size_t size)
mem = malloc (size);

if (!mem)
nns_edge_loge ("Failed to allocate memory (%llu).", size);
nns_edge_loge ("Failed to allocate memory");
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason to change this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

%lu or %llu is required when building in 32bit and 64bit with gbs.
I tried to solve it with glib API, but nnstreamer-edge does not have glib dependency.
There is also a way to use the C library.
Since there was only one log, I agreed with @gichan-jang to delete it for now.

Copy link
Member

Choose a reason for hiding this comment

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

typedef uint64_t nns_size_t;

If it was size_t, you may use %zu, but that's just uint64_t. You may refer to https://stackoverflow.com/questions/30092872/how-to-print-uint64-t-in-gcc too.

Copy link
Member

Choose a reason for hiding this comment

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

A major NNStreamer VoC is that error messages do not give you enough info. Please do not reduce info in error messages. Please add more info.

Copy link
Contributor Author

@songgot songgot Dec 6, 2023

Choose a reason for hiding this comment

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

${NNS_EDGE_SRC_DIR}/nnstreamer-edge-util.c
${NNS_EDGE_SRC_DIR}/nnstreamer-edge-queue.c
)
IF (NOT ENABLE_TIZEN)
SET(NNS_EDGE_SRCS ${NNS_EDGE_SRCS} ${NNS_EDGE_SRC_DIR}/nnstreamer-edge-log.c)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the nnstreamer-edge-log.c excluded when ENABLE_TIZEN is off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If not using Tizen or Android, nns_edge_print_log() in nnstreamer-edge-log.c is used.

Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@songgot songgot changed the title [bugfix] Modify dlog output code [Wait for #196][bugfix] Modify dlog output code Dec 4, 2023
@taos-ci
Copy link
Collaborator

taos-ci commented Dec 4, 2023

:octocat: cibot: @songgot, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nnstreamer-edge/ci/repo-workers/pr-checker/191-202312041844230.5980179309845-862b7fc85ee6e680ae95e6cce9f01305cc957d30/.

Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@songgot songgot changed the title [Wait for #196][bugfix] Modify dlog output code [bugfix] Modify dlog output code Dec 6, 2023
When outputting dlog using dlogutil in Tizen, garbage values are output
in the format starting with %

Signed-off-by: hyunil park <[email protected]>
Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@songgot, 💯 All CI checkers are successfully verified. Thanks.

@jaeyun-jung jaeyun-jung merged commit b71723c into nnstreamer:main Dec 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants