Skip to content

Fix CSV timestamp output with multi-character delimiters - #1050

Merged
rdementi merged 1 commit into
intel:masterfrom
Shubham-Padkonde:fix/csv-timestamp-delimiter
Sep 16, 2026
Merged

rdementi merged 1 commit into
intel:masterfrom
Shubham-Padkonde:fix/csv-timestamp-delimiter

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

Problem

With a multi-character CSV delimiter, pcm-iio removes only the final character from the timestamp prefix. For ||, the header contains Date||Time|||Socket; an empty delimiter instead truncates Time to Tim. The same timestamp helper is used for data rows.

Change

Remove the full trailing delimiter before combining the timestamp with the remaining columns. Add a public display-builder regression test covering comma, ||, :::, and empty delimiters.

Validation

  • New regression fails on the original code for both multi-character delimiters and the empty delimiter.
  • Built pcm-iio-utest with CMake and GCC 13; all 4 tests pass after the fix.
  • git diff --check passes.

Prepared with Codex assistance.

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.

🟢 Approval recommended

The focused fix correctly handles all supported delimiter lengths and includes appropriate regression coverage.

Pull request overview

Fixes CSV timestamp formatting when delimiters contain multiple characters or are empty.

Changes:

  • Removes the complete trailing delimiter from generated timestamps.
  • Adds regression coverage for comma, multi-character, and empty delimiters.
File summaries
File Description
src/pcm-iio-pmu.cpp Removes the full delimiter suffix from timestamps.
tests/utests/pcm-iio-utest.cpp Verifies correctly formatted CSV headers across delimiter variants.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rdementi rdementi 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.

thanks!

@rdementi
rdementi merged commit 1e218d2 into intel:master Sep 16, 2026
28 checks passed
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.

3 participants