Nishant Puri has uploaded this change for review.

View Change

log: skip conditional log check on isLevel when no targets configured

isLevel() is on the hot path, called for every log statement.
The call to is_op_context_conditional_flag_set() is always a no-op
when no exports or clients have conditional logging configured,
but still incurs full function call overhead on every invocation.

Introduce a bool conditional_logging_configured. Guard the
is_op_context_conditional_flag_set() call in isLevel() with
unlikely(conditional_logging_configured). In production,
where no conditional logging is active, the branch predictor
skips the call entirely at zero overhead.

Change-Id: Ia91dfedb143bcdf13c2cfd6cb58b8c2efc8b04ed
Signed-off-by: Nishant Puri <npuri@redhat.com>
---
M src/MainNFSD/libganesha_nfsd.ver
M src/include/log.h
M src/log/log_functions.c
3 files changed, 23 insertions(+), 2 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/43/1236743/1

To view, visit change 1236743. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ia91dfedb143bcdf13c2cfd6cb58b8c2efc8b04ed
Gerrit-Change-Number: 1236743
Gerrit-PatchSet: 1
Gerrit-Owner: Nishant Puri <npuri@redhat.com>