Skip to content

Commit 3e18cdc

Browse files
committed
SWPTP-1421: add most and all virtual trace modules
1 parent 59af5cc commit 3e18cdc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2626
- Add `phc_dedup` option to identify duplicate non-Solarflare PHC devices
2727
sharing a single NIC clock and treat as one device. (SWPTP-1348)
2828
- This option requires a calibration step that may take a few seconds.
29+
- Add `trace_level all <n>` option or `most` omitting `threading`. (SWPTP-1421)
2930
- Add configurable run, state, control and metrics access modes. (SWPTP-1551)
3031
- Add `servo_log_all_samples` option. (SWPTP-1566)
3132
- Add new clock display format interpolators. (SWPTP-1569)

src/sfptpd_general_config.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static const sfptpd_config_option_t config_general_options[] =
339339
1, SFPTPD_CONFIG_SCOPE_INSTANCE,
340340
parse_pid_filter_ki,
341341
.dfl = SFPTPD_CONFIG_DFL(SFPTPD_DEFAULT_SERVO_K_INTEGRAL)},
342-
{"trace_level", "[<general | threading | bic | netlink | ntp | servo | clocks>] NUMBER",
342+
{"trace_level", "[<general | threading | bic | netlink | ntp | servo | clocks | most | all>] NUMBER",
343343
"Specifies a module (of 'general' if omitted) trace level from 0 (none) to 6 (excessive)",
344344
~1, SFPTPD_CONFIG_SCOPE_GLOBAL,
345345
parse_trace_level,
@@ -1487,6 +1487,9 @@ static int parse_trace_level(struct sfptpd_config_section *section, const char *
14871487
if (tokens != 1)
14881488
return EINVAL;
14891489

1490+
if (strcmp(module_name, "all") == 0)
1491+
general->threading_trace_level = trace_level;
1492+
14901493
if (strcmp(module_name, "general") == 0)
14911494
general->trace_level = trace_level;
14921495
else if (strcmp(module_name, "threading") == 0)
@@ -1501,7 +1504,14 @@ static int parse_trace_level(struct sfptpd_config_section *section, const char *
15011504
general->servo_trace_level = trace_level;
15021505
else if (strcmp(module_name, "clocks") == 0)
15031506
general->clocks_trace_level = trace_level;
1504-
else {
1507+
else if (strcmp(module_name, "most") == 0 || strcmp(module_name, "all") == 0) {
1508+
general->trace_level = trace_level;
1509+
general->bic_trace_level = trace_level;
1510+
general->netlink_trace_level = trace_level;
1511+
general->ntp_trace_level = trace_level;
1512+
general->servo_trace_level = trace_level;
1513+
general->clocks_trace_level = trace_level;
1514+
} else {
15051515
ERROR("Unknown <module> argument for `trace_level`: '%s'\n", module_name);
15061516
return EINVAL;
15071517
}

0 commit comments

Comments
 (0)