Skip to content

Add profile filtering and fix DPLL lock detection#7

Open
alegacy wants to merge 2 commits into
redhat-cne:mainfrom
alegacy:feature/add-profile-filtering
Open

Add profile filtering and fix DPLL lock detection#7
alegacy wants to merge 2 commits into
redhat-cne:mainfrom
alegacy:feature/add-profile-filtering

Conversation

@alegacy
Copy link
Copy Markdown
Contributor

@alegacy alegacy commented May 14, 2026

Summary

  • Add optional profile_name parameter to all log-based MCP tools (get_ptp_logs, get_grandmaster_status, analyze_sync_status, get_clock_hierarchy, check_ptp_health) for per-profile log filtering in multi-profile setups (T-BC, QE multi-clock)
  • Extract config tags from log lines and scan all runtime config files (ptp4l, ts2phc, phc2sys) so a single profile name resolves to the full set of config files for that profile
  • Strip extracted summaries from get_ptp_logs — it now returns raw log entries only; callers should use dedicated analysis tools instead
  • Fix DPLL lock detection: extract_sync_status was looking for a non-existent "decision" keyword in DPLL messages; now correctly uses phase_status from dpll component logs and In spec from Go-style dpll event logs
  • Restore offset_in_range sourced from the daemon's own hardware-reported In spec field rather than an arbitrary software threshold

Tested against cnfdg28 (single OC slave profile) and cnfdg3 (T-BC with tbc-tr and tbc-tt profiles).

🤖 Generated with Claude Code

alegacy and others added 2 commits May 14, 2026 10:01
Parse the config tag from log lines (e.g., ptp4l.0.config from
"[ptp4l.0.config:6]") and store it in parsed_data during log parsing.
Add optional config_tag parameter to all extraction methods in the
log parser for per-profile filtering.

Add profile_name parameter to get_ptp_logs, get_grandmaster_status,
analyze_sync_status, get_clock_hierarchy, and check_ptp_health tools.
The profile name is resolved to a config_tag via the runtime config
mapping so the LLM only needs to know profile names, not internal
config file paths.

This enables correct per-profile analysis in T-BC setups where
multiple ptp4l instances produce interleaved log output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Allain Legacy <alegacy@redhat.com>
extract_sync_status was filtering for a "decision" keyword in DPLL
log messages that doesn't exist in actual linuxptp-daemon output.
Fix to match dpll component logs by the phase_status field from
the parsed data instead. phase_status == 3 indicates DPLL locked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Allain Legacy <alegacy@redhat.com>
@alegacy
Copy link
Copy Markdown
Contributor Author

alegacy commented May 14, 2026

@nocturnalastro I've fixed up the profile support and applied it to the existing tools with some cleanup. Once this merges I'll update the other tools in the WIP stack (feature/ai-investigation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant