Skip to content

Fix incorrect t2_event_f() usage in performance monitoring doc example#281

Closed
Copilot wants to merge 1 commit intofeature/agentic-proces-improvemntfrom
copilot/sub-pr-278-again
Closed

Fix incorrect t2_event_f() usage in performance monitoring doc example#281
Copilot wants to merge 1 commit intofeature/agentic-proces-improvemntfrom
copilot/sub-pr-278-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

The code example in docs/api/public-api.md called t2_event_f() with a format string and variadic args, which does not match the function signature — t2_event_f() accepts a single double, not a printf-style format string.

Change

  • Replaced the invalid t2_event_f("Slow_Operation", "name=%s,duration_ms=%.2f", operation_name, duration_ms) call with snprintf to compose the marker string, then a correct t2_event_f(marker, duration_ms) call.
// Before (incorrect)
t2_event_f("Slow_Operation",
            "name=%s,duration_ms=%.2f",
            operation_name, duration_ms);

// After (correct)
snprintf(marker, sizeof(marker), "%s_Duration_ms", operation_name);
t2_event_f(marker, duration_ms);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Work in progress to address feedback on agentic development Fix incorrect t2_event_f() usage in performance monitoring doc example Mar 6, 2026
@shibu-kv shibu-kv closed this Mar 10, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants