Skip to content

refactor: cleanup pg/stdio ebpf functions#28

Merged
kemingy merged 2 commits into
mainfrom
cleanup_pg_stdio_ebpf
Apr 29, 2026
Merged

refactor: cleanup pg/stdio ebpf functions#28
kemingy merged 2 commits into
mainfrom
cleanup_pg_stdio_ebpf

Conversation

@kemingy
Copy link
Copy Markdown
Member

@kemingy kemingy commented Apr 29, 2026

No description provided.

Signed-off-by: Keming <kemingyang@tensorchord.ai>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the stdio and Postgres eBPF probes to reduce duplicated logic by extracting common “emit event” and parsing helpers, aiming to make the probe code easier to read and maintain.

Changes:

  • Added a shared stdio ringbuf event emitter helper and used it from read/write tracepoints.
  • Refactored Postgres startup packet detection into a helper and introduced shared event metadata/emission helpers.
  • Centralized Postgres message-type filtering into a helper.

Reviewed changes

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

File Description
stdio/stdio.bpf.c Extracts duplicated ringbuf event emission into emit_stdio_event() and uses it from read/write handlers.
postgres/pg.bpf.c Refactors startup detection and event emission into helpers; adjusts plaintext gating and message-type filtering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread postgres/pg.bpf.c
Comment thread stdio/stdio.bpf.c
the negotiation may fallback to plaintext

Signed-off-by: Keming <kemingyang@tensorchord.ai>
@kemingy kemingy merged commit 80863ae into main Apr 29, 2026
3 checks passed
@kemingy kemingy deleted the cleanup_pg_stdio_ebpf branch April 29, 2026 06:28
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.

2 participants