Skip to content

Add doxygen comments to DiagsTypes.hh - #13262

Open
JosiahWI wants to merge 14 commits into
apache:masterfrom
JosiahWI:doc/diags
Open

Add doxygen comments to DiagsTypes.hh#13262
JosiahWI wants to merge 14 commits into
apache:masterfrom
JosiahWI:doc/diags

Conversation

@JosiahWI

@JosiahWI JosiahWI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I am testing out Claude Sonnet 4.6 and Claude Opus 4.7 with spec-kit. This change was generated by those models. Since code comments are very tedious to write by hand (especially for pre-existing code) and can provide great benefit, I think this is a good use case for experimentation. If this is accepted, I might do more of these as I refine my spec-kit configuration.

@JosiahWI JosiahWI self-assigned this Jun 12, 2026
Copilot AI review requested due to automatic review settings June 12, 2026 12:50
@JosiahWI JosiahWI added this to the 11.0.0 milestone Jun 12, 2026
@JosiahWI JosiahWI changed the title Add oxygen comments to diagnostic system Add doxygen comments to diagnostic system Jun 12, 2026
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Doxygen (“oxygen”) comments to ATS’s diagnostics and regression-test interfaces to make the Diags subsystem’s behavior easier to understand and navigate from headers.

Changes:

  • Adds API-level documentation for tell_diags_regression_testing_is_on() in Regression.h.
  • Adds extensive Doxygen comments across DiagsTypes.h for Diags configuration, tag activation, output routing, and log rolling/redirection APIs.
  • Adds documentation for the global Diags singleton registration/access in Diags.h.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 13 comments.

File Description
include/tscore/Regression.h Documents regression-mode diags behavior.
include/tscore/DiagsTypes.h Adds Doxygen comments for Diags types, fields, and public APIs.
include/tscore/Diags.h Documents DiagsPtr::set() and diags() singleton accessor.

Comment thread include/tscore/Regression.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/Diags.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Copilot AI review requested due to automatic review settings June 12, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

Comment thread include/tscore/Regression.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/Diags.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 20 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
@JosiahWI
JosiahWI requested a review from Copilot June 13, 2026 16:15
@JosiahWI JosiahWI changed the title Add doxygen comments to diagnostic system Add doxygen comments to DiagsTypes.hh Jun 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread src/tscore/Diags.cc
Comment thread src/tscore/Diags.cc
Comment thread src/tscore/Diags.cc

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h Outdated
Comment thread include/tscore/DiagsTypes.h

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread src/tscore/Diags.cc
Comment thread src/tscore/Diags.cc
Comment thread include/tscore/DiagsTypes.h
Comment thread include/tscore/DiagsTypes.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread src/tscore/Diags.cc
Comment thread include/tscore/DiagsTypes.h
Comment thread include/tscore/DiagsTypes.h
@JosiahWI
JosiahWI marked this pull request as ready for review June 13, 2026 19:16
Comment thread include/tscore/DiagsTypes.h Outdated
@cmcfarlen
cmcfarlen self-requested a review June 15, 2026 22:28
Copilot AI review requested due to automatic review settings July 31, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

include/tscore/DiagsTypes.h:611

  • activate_taglist()’s Thread safety note says it “Acquires tag_table_lock”, but the implementation only takes the lock when @a taglist is non-null (to swap activated_tags[mode]). When @a taglist is nullptr and @a mode is DiagsTagType_Action (or non-global debug), no lock is taken. Tighten the wording so it matches the actual locking behavior.
   * @par Thread safety
   * Acquires tag_table_lock. Safe to call concurrently with
   *   emission, but serialized with other reconfiguration methods.

include/tscore/DiagsTypes.h:125

  • The DiagsCleanupFunc documentation describes DL_Fatal/DL_Alert as exiting via a “recoverable path”. The implementation uses ink_fatal_va() which unconditionally terminates the process via _exit(70); nothing is actually “recoverable”. Consider documenting the concrete exit statuses instead (UNRECOVERABLE_EXIT vs 70) to avoid implying the process continues.

This issue also appears on line 609 of the same file.

 * @post On return, the process is terminated; control does not return to
 *   the emitter. DL_Emergency exits via the unrecoverable path; DL_Fatal
 *   and DL_Alert exit via the recoverable path.

Comment thread src/tscore/Diags.cc
Comment on lines 417 to +421
if (DiagsLevel_IsTerminal(level)) {
va_list ap2;

va_copy(ap2, ap);
// No re-entry guard: if two threads emit a terminal-level message

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Out of scope and won't fix here, but might be a bug.

@JosiahWI
JosiahWI requested a review from bneradt August 12, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants