Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/admin/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ level of logging on a per-subsystem basis as well
("D_LOG_MASK=DEBUG,MEM=ERR").

- Log Levels:
debug, dbug, info, note, warn, error, err, crit, alrt, fatal, emrg, emit
debug, dbug, info, note, warn, error, err, crit, alrt, fatal, emit

Note: debug == dbug, error == err and fatal == emrg.
Note: debug == dbug and error == err.

### Debug Masks/Streams:

Expand Down
2 changes: 1 addition & 1 deletion src/cart/README.env
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This file lists the environment variables used in CaRT.

. D_LOG_FLUSH
Specifies priority level for flushing of messages into the log file.
Can be set to one of the following "DBUG,INFO,NOTE,WARN,ERR,CRIT,ALRT,EMRG,EMIT"
Can be set to one of the following "DBUG,INFO,NOTE,WARN,ERR,CRIT,ALRT,EMIT"
If not set will default to "WARN".

. DD_STDERR
Expand Down
4 changes: 2 additions & 2 deletions src/control/cmd/ddb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ func strToLogLevels(level string) (logging.LogLevel, engine.LogLevel, error) {
return logging.LogLevelError, engine.LogLevelCrit, nil
case "ALRT":
return logging.LogLevelError, engine.LogLevelAlrt, nil
case "FATAL", "EMRG":
return logging.LogLevelError, engine.LogLevelEmrg, nil
case "FATAL":
return logging.LogLevelError, engine.LogLevelFatal, nil
case "EMIT":
return logging.LogLevelError, engine.LogLevelEmit, nil
default:
Expand Down
2 changes: 1 addition & 1 deletion src/control/cmd/ddb/manpage.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The Go CLI and the C engine use separate logging systems with different log leve
The \fI--debug=<log level>\fR option sets the log level for both systems to the closest matching
levels. The available log levels are: \fBTRACE\fR, \fBDEBUG\fR (or \fBDBUG\fR), \fBINFO\fR,
\fBNOTICE\fR (or \fBNOTE\fR), \fBWARN\fR, \fBERROR\fR (or \fBERR\fR), \fBCRIT\fR, \fBALRT\fR,
\fBFATAL\fR (or \fBEMRG\fR), and \fBEMIT\fR. The default log level is \fBERROR\fR.
\fBFATAL\fR, and \fBEMIT\fR. The default log level is \fBERROR\fR.

Logs can be redirected to a file using the \fI--log_dir=<path>\fR option. Note that \fBERROR\fR
and above are always printed to the console, even when \fI--log_dir\fR is set.`
Expand Down
13 changes: 7 additions & 6 deletions src/control/server/engine/utils.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// (C) Copyright 2021-2023 Intel Corporation.
// (C) Copyright 2026 Hewlett Packard Enterprise Development LP
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -65,7 +66,7 @@ const (
LogLevelErr
LogLevelCrit
LogLevelAlrt
LogLevelEmrg
LogLevelFatal
LogLevelEmit
)

Expand All @@ -85,8 +86,8 @@ func (ll LogLevel) String() string {
return "CRIT"
case LogLevelAlrt:
return "ALRT"
case LogLevelEmrg:
return "EMRG"
case LogLevelFatal:
return "FATAL"
case LogLevelEmit:
return "EMIT"
default:
Expand All @@ -111,8 +112,8 @@ func StrToLogLevel(s string) LogLevel {
return LogLevelCrit
case "ALRT":
return LogLevelAlrt
case "FATAL", "EMRG":
return LogLevelEmrg
case "FATAL":
return LogLevelFatal
case "EMIT":
return LogLevelEmit
default:
Expand All @@ -123,7 +124,7 @@ func StrToLogLevel(s string) LogLevel {
var (
validLogLevels = []string{
"DEBUG", "DBUG", "INFO", "NOTE", "WARN", "ERROR", "ERR", "CRIT", "ALRT", "FATAL",
"EMRG", "EMIT",
"EMIT",
}
validLogStreams = []string{
"ALL", // Select all streams
Expand Down
4 changes: 2 additions & 2 deletions src/gurt/dlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static const char *clog_pristr(int);
static int clog_setnfac(int);

/* static arrays for converting between pri's and strings */
static const char * const norm[] = { "DBUG", "INFO", "NOTE", "WARN", "ERR ",
"CRIT", "ALRT", "EMRG", "EMIT"};
static const char *const norm[] = { "DEBUG", "INFO ", "NOTE ", "WARN ", "ERROR",
"CRIT ", "ALRT ", "FATAL", "EMIT "};
/**
* clog_pristr: convert priority to 4 byte symbolic name.
*
Expand Down
54 changes: 30 additions & 24 deletions src/tests/ftest/cart/util/cart_logparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ class InvalidLogFile(Exception):
LOG_LEVELS = {
'EMIT': 1,
'FATAL': 2,
'EMRG': 3,
'CRIT': 4,
'ERR': 5,
'WARN': 6,
'NOTE': 7,
'INFO': 8,
'DBUG': 9}
'CRIT': 3,
'ERROR': 4,
'WARN': 5,
'NOTE': 6,
'INFO': 7,
'DEBUG': 8}

# Make a reverse lookup from log level to name.
LOG_NAMES = {}
Expand Down Expand Up @@ -72,9 +71,14 @@ class LogLine():

# pylint: disable=too-many-public-methods

# Match a log tag with pid/tid/uid ('TAG[pid/tid/uid]').
# Assumes DLOG_FLV_TAG and DLOG_FLV_LOGPID are set.
_pid_tag_re = re.compile(r'.+\[\d+/\d+/\d+\]')

@staticmethod
def is_valid(line):
"""Return True if a valid CaRT log line is recognized."""
"""Return True if a valid CaRT log line is recognized.
"""
fields = line.split(None, 6)
return (
# pylint: disable=too-many-boolean-expressions
Expand All @@ -87,26 +91,28 @@ def is_valid(line):
and len(fields[1]) == 10 and fields[1][4] == '/' and fields[1][7] == '/'
# Valid time: hh:mm:ss.micros
and len(fields[2]) == 15 and fields[2][2] == ':' and fields[2][8] == '.'
# Assuming DLOG_FLV_TAG and DLOG_FLV_LOGPID are set: TAG[pid/tid/uid]
and LogLine._pid_tag_re.fullmatch(fields[4])
# pylint: enable=too-many-boolean-expressions
)

# Match an address range, a region in memory.
re_region = re.compile(r"(0|0x[0-9a-f]{1,16})-(0x[0-9a-f]{1,16})")
_re_region = re.compile(r"(0|0x[0-9a-f]{1,16})-(0x[0-9a-f]{1,16})")
# Match a pointer, with optional ')', '.' or ',' suffix.
re_pointer = re.compile(r"0x[0-9a-f]{1,16}((\)|\.|\,)?)")
_re_pointer = re.compile(r"0x[0-9a-f]{1,16}((\)|\.|\,)?)")
# Match a pid marker
re_pid = re.compile(r"pid=(\d+)")
_re_pid = re.compile(r"pid=(\d+)")

# Match a truncated uuid from DF_UUID
re_uuid = re.compile(r"[0-9a-f]{8}(:|\,?)")
_re_uuid = re.compile(r"[0-9a-f]{8}(:|\,?)")
# Match a truncated uuid[rank] from DF_DB
re_uuid_rank = re.compile(r"[0-9,a-f]{8}\[\d+\](:?)")
_re_uuid_rank = re.compile(r"[0-9,a-f]{8}\[\d+\](:?)")
# Match from DF_UIOD
re_uiod = re.compile(r"\d{1,20}\.\d{1,20}.(\d{1,10})")
_re_uiod = re.compile(r"\d{1,20}\.\d{1,20}.(\d{1,10})")
# Match a RPCID from RPC_TRACE macro.
re_rpcid = re.compile(r"rpcid=0x[0-9a-f]{1,16}")
_re_rpcid = re.compile(r"rpcid=0x[0-9a-f]{1,16}")
# Match DF_CONT
re_cont = re.compile(r"[0-9a-f]{8}/[0-9a-f]{8}(:?)")
_re_cont = re.compile(r"[0-9a-f]{8}/[0-9a-f]{8}(:?)")

def __init__(self, line):
# The format of log lines depends on the flags (DLOG_FLV_*) passed during initialization.
Expand Down Expand Up @@ -210,36 +216,36 @@ def get_anon_msg(self):
for entry in self._fields[2:]:
field = None

r = self.re_region.fullmatch(entry)
r = self._re_region.fullmatch(entry)
if r:
field = '0x...-0x...'

if not field:
r = self.re_pointer.fullmatch(entry)
r = self._re_pointer.fullmatch(entry)
if r:
field = '0x...{}'.format(r.group(1))
if not field:
r = self.re_pid.fullmatch(entry)
r = self._re_pid.fullmatch(entry)
if r:
field = 'pid=<pid>'
if not field:
r = self.re_uuid.fullmatch(entry)
r = self._re_uuid.fullmatch(entry)
if r:
field = 'uuid{}'.format(r.group(1))
if not field:
r = self.re_uuid_rank.fullmatch(entry)
r = self._re_uuid_rank.fullmatch(entry)
if r:
field = 'uuid/rank{}'.format(r.group(1))
if not field:
r = self.re_uiod.fullmatch(entry)
r = self._re_uiod.fullmatch(entry)
if r:
field = 'uoid.{}'.format(r.group(1))
if not field:
r = self.re_rpcid.fullmatch(entry)
r = self._re_rpcid.fullmatch(entry)
if r:
field = 'rpcid=<rpcid>'
if not field:
r = self.re_cont.fullmatch(entry)
r = self._re_cont.fullmatch(entry)
if r:
field = 'pool/cont{}'.format(r.group(1))
if field:
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/general_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def get_errors_count(log, hostlist, file_glob):
"""
# Get the Client side Error from client_log file.
cmd = "cat {} | sed -n -E -e ".format(get_log_file(file_glob))
cmd += r"'/^ERR[[:space:]].+[[:space:]]DER_[^(]+\([^)]+\).+$/"
cmd += r"'/^ERROR[[:space:]].+[[:space:]]DER_[^(]+\([^)]+\).+$/"
cmd += r"s/^.+[[:space:]]DER_[^(]+\((-[[:digit:]]+)\).+$/\1/p'"
result = run_remote(log, hostlist, cmd, verbose=False)
errors_count = {}
Expand Down
4 changes: 2 additions & 2 deletions utils/config/daos_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
# # Mask specifies minimum level of message significance to pass to logger.
# # Currently supported values:
# # DEBUG, DBUG (alias for DEBUG), INFO, NOTE, WARN, ERROR, ERR (alias for ERROR), CRIT, ALRT,
# # FATAL, EMRG, EMIT
# # FATAL, EMIT
# #
# # default: ERR
# log_mask: INFO
Expand Down Expand Up @@ -595,7 +595,7 @@
# # Mask specifies minimum level of message significance to pass to logger.
# # Currently supported values:
# # DEBUG, DBUG (alias for DEBUG), INFO, NOTE, WARN, ERROR, ERR (alias for ERROR), CRIT, ALRT,
# # FATAL, EMRG, EMIT
# # FATAL, EMIT
# #
# # default: ERR
# log_mask: INFO
Expand Down
Loading