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

common: no out_*() functions in release build #6026

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

grom72
Copy link
Contributor

@grom72 grom72 commented Feb 23, 2024

@grom72 grom72 added sprint goal This pull request is part of the ongoing sprint no changelog Add to skip the changelog check on your pull request labels Feb 23, 2024
@grom72 grom72 requested a review from janekmi February 23, 2024 14:46
@grom72 grom72 changed the title common: no out_() functions in release build common: no out_*() functions in release build Feb 23, 2024
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.05%. Comparing base (6b911a6) to head (2129693).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6026   +/-   ##
=======================================
  Coverage   70.04%   70.05%           
=======================================
  Files         133      133           
  Lines       19564    19563    -1     
  Branches     3263     3263           
=======================================
  Hits        13704    13704           
+ Misses       5860     5859    -1     

Copy link
Contributor

@janekmi janekmi left a 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 r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @grom72)

a discussion (no related file):
Please also:

  • remove out_log_va() from the out.h header and
  • wrap the out_log() declaration in the out.h header into #ifdef DEBUG just to make things clear.


src/core/out.c line 164 at r1 (raw file):

	CORE_LOG_HARK("pid %d: program: %s", getpid(),
		util_getexecname(namepath, PATH_MAX));
#endif	/* DEBUG */

Suggestion:

	static char namepath[PATH_MAX];
	CORE_LOG_HARK("pid %d: program: %s", getpid(),
		util_getexecname(namepath, PATH_MAX));

src/core/out.c line 193 at r1 (raw file):

	CORE_LOG_HARK("%s", drd_msg);
#endif /* VG_DRD_ENABLED */
#endif

Suggestion:

#endif /* DEBUG */

src/core/out.c line 309 at r1 (raw file):

void
out_log_va(const char *file, int line, const char *func, int level,
		const char *fmt, va_list ap)

Suggestion:

static void
out_log_va(const char *file, int line, const char *func, int level,
		const char *fmt, va_list ap)

Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @janekmi)

a discussion (no related file):

Previously, janekmi (Jan Michalski) wrote…

Please also:

  • remove out_log_va() from the out.h header and
  • wrap the out_log() declaration in the out.h header into #ifdef DEBUG just to make things clear.

Done.



src/core/out.c line 164 at r1 (raw file):

	CORE_LOG_HARK("pid %d: program: %s", getpid(),
		util_getexecname(namepath, PATH_MAX));
#endif	/* DEBUG */

Done.


src/core/out.c line 193 at r1 (raw file):

	CORE_LOG_HARK("%s", drd_msg);
#endif /* VG_DRD_ENABLED */
#endif

Done.


src/core/out.c line 309 at r1 (raw file):

void
out_log_va(const char *file, int line, const char *func, int level,
		const char *fmt, va_list ap)

Done.

Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @janekmi)

a discussion (no related file):

Previously, grom72 (Tomasz Gromadzki) wrote…

Done.

Small fix:
can not wrap out_log() as it is used in ut_log_function :(


Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @janekmi)

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @grom72)

a discussion (no related file):

can not wrap out_log() as it is used in ut_log_function :(

How can it be without DEBUG if you had just made it available only if DEBUG is set?


Copy link
Contributor Author

@grom72 grom72 left a 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, 1 unresolved discussion (waiting on @janekmi)

a discussion (no related file):

Previously, janekmi (Jan Michalski) wrote…

can not wrap out_log() as it is used in ut_log_function :(

How can it be without DEBUG if you had just made it available only if DEBUG is set?

ut_log_function() is used in debug and non debug builds


Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @grom72)

@janekmi janekmi merged commit 03a2082 into pmem:master Feb 29, 2024
8 checks passed
@grom72 grom72 deleted the no-out.c-in-release branch February 29, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Add to skip the changelog check on your pull request sprint goal This pull request is part of the ongoing sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants