-
Notifications
You must be signed in to change notification settings - Fork 510
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
common: print basic lib info when new logging function is set #6021
Conversation
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
1affe63
to
f7442b1
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6021 +/- ##
==========================================
+ Coverage 70.03% 70.05% +0.01%
==========================================
Files 133 133
Lines 19562 19564 +2
Branches 3263 3263
==========================================
+ Hits 13701 13705 +4
+ Misses 5861 5859 -2 |
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.
Reviewed 17 of 17 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @grom72)
src/core/out.c
line 162 at r1 (raw file):
CORE_LOG_HARK("pid %d: program: %s", getpid(), util_getexecname(namepath, PATH_MAX)); #endif /* DEBUG */
Suggestion:
#ifdef DEBUG
if (log_level != NULL || log_file != NULL) {
ret = core_log_set_function(out_legacy, NULL);
if (ret) {
CORE_LOG_FATAL("Cannot set legacy log function");
}
}
static char namepath[PATH_MAX];
CORE_LOG_HARK("pid %d: program: %s", getpid(),
util_getexecname(namepath, PATH_MAX));
#endif /* DEBUG */
src/test/traces/custom_file0.log.match
line 3 at r1 (raw file):
$(nW) <1> $(nW) $(nW) src version: $(nW) $(nW) <1> $(nW) $(nW) compiled with support for shutdown state $(nW) <1> $(nW) $(nW) compiled with libndctl 63+
Why are these lines $(OPT)
in a few other tests but not here?
Code quote:
$(nW) <1> $(nW) $(nW) compiled with support for shutdown state
$(nW) <1> $(nW) $(nW) compiled with libndctl 63+
src/test/traces/redir_stderr2.log.match
line 3 at r1 (raw file):
$(nW) <1> $(nW) $(nW) src version: $(nW) $(nW) <1> $(nW) $(nW) compiled with support for shutdown state $(nW) <1> $(nW) $(nW) compiled with libndctl 63+
.
Code quote:
$(nW) <1> $(nW) $(nW) compiled with support for shutdown state
$(nW) <1> $(nW) $(nW) compiled with libndctl 63+
src/test/traces/redir_stderr3.log.match
line 3 at r1 (raw file):
$(nW) <1> $(nW) $(nW) src version: $(nW) $(nW) <1> $(nW) $(nW) compiled with support for shutdown state $(nW) <1> $(nW) $(nW) compiled with libndctl 63+
.
Code quote:
$(nW) <1> $(nW) $(nW) compiled with support for shutdown state
$(nW) <1> $(nW) $(nW) compiled with libndctl 63+
src/test/traces/redir_stderr4.log.match
line 3 at r1 (raw file):
$(nW) <1> $(nW) $(nW) src version: $(nW) $(nW) <1> $(nW) $(nW) compiled with support for shutdown state $(nW) <1> $(nW) $(nW) compiled with libndctl 63+
.
Code quote:
$(nW) <1> $(nW) $(nW) compiled with support for shutdown state
$(nW) <1> $(nW) $(nW) compiled with libndctl 63+
src/test/traces/redir_stderr5.log.match
line 3 at r1 (raw file):
$(nW) <1> $(nW) $(nW) src version: $(nW) $(nW) <1> $(nW) $(nW) compiled with support for shutdown state $(nW) <1> $(nW) $(nW) compiled with libndctl 63+
.
Code quote:
$(nW) <1> $(nW) $(nW) compiled with support for shutdown state
$(nW) <1> $(nW) $(nW) compiled with libndctl 63+
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
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.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @janekmi)
src/core/out.c
line 162 at r1 (raw file):
CORE_LOG_HARK("pid %d: program: %s", getpid(), util_getexecname(namepath, PATH_MAX)); #endif /* DEBUG */
Intentionally left as two separate sections as they are not related to each other.
src/test/traces/custom_file0.log.match
line 3 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
Why are these lines
$(OPT)
in a few other tests but not here?
$(OPT) are needed only for build w/o ndctl, and SDS support.
We do not have such tests/build so here it is OK and $(OPT) can be removed from other locations.
src/test/traces/redir_stderr2.log.match
line 3 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
.
.
src/test/traces/redir_stderr3.log.match
line 3 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
.
.
src/test/traces/redir_stderr4.log.match
line 3 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
.
.
src/test/traces/redir_stderr5.log.match
line 3 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
.
.
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
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.
Reviewed 17 of 17 files at r1, 1 of 1 files at r2, 1 of 16 files at r3, all commit messages.
Reviewable status: 3 of 18 files reviewed, 6 unresolved discussions (waiting on @janekmi)
src/test/traces/custom_file0.log.match
line 3 at r1 (raw file):
Previously, grom72 (Tomasz Gromadzki) wrote…
$(OPT) are needed only for build w/o ndctl, and SDS support.
We do not have such tests/build so here it is OK and $(OPT) can be removed from other locations.
But finally, I added it everywhere as these are optional messages.
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.
Reviewed 12 of 16 files at r3.
Reviewable status: 15 of 18 files reviewed, 6 unresolved discussions (waiting on @janekmi)
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.
Reviewed 2 of 16 files at r3.
Reviewable status: 17 of 18 files reviewed, 6 unresolved discussions (waiting on @janekmi)
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.
Reviewed 1 of 16 files at r3.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @janekmi)
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @janekmi)
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.
🐐
Reviewed 16 of 16 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @grom72)
src/core/out.c
line 91 at r4 (raw file):
if (align > 0) Log_alignment = (unsigned)align; }
Just FYI it seems both Log_prefix
and Log_alignment
are in use only in debug now.
Code quote:
Log_prefix = log_prefix;
char *log_alignment = os_getenv("PMDK_LOG_ALIGN");
if (log_alignment) {
int align = atoi(log_alignment);
if (align > 0)
Log_alignment = (unsigned)align;
}
src/core/out.c
line 124 at r4 (raw file):
Out_fp = stderr; else setlinebuf(Out_fp);
The same for Out_fp
.
Code quote:
if (Out_fp == NULL)
Out_fp = stderr;
else
setlinebuf(Out_fp);
src/test/traces/custom_file0.log.match
line 3 at r1 (raw file):
Previously, grom72 (Tomasz Gromadzki) wrote…
But finally, I added it everywhere as these are optional messages.
Actually, we are building PMDK without NDCTL here: https://github.com/pmem/pmdk/blob/master/.github/workflows/pmem_tests.yml#L87
$(OPT) is ok.
This change is