Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracefs: minor cleanups #1027

Merged
merged 6 commits into from
May 15, 2023
Merged

tracefs: minor cleanups #1027

merged 6 commits into from
May 15, 2023

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Apr 26, 2023

tracefs: use stringer for ProbeType

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

link: always set a finalizer on perfEvent

We currently set a finalizer in attachPerfEventLink and
attachPerfEventIoctl. Instead always set a finalizer on the perfEvent to
ensure that we close perf event and tracefs event in the right order.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

link: remove perfEvent.cookie

The cookie field is only used to pass a parameter to the perfEventAttach 
function. Remove it from perfEvent and pass the cookie directly.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

link: remove perfEvent.typ

Remove perfEvent.typ, since the only use is a check against prog.Type() in
attachPerfEvent. This check already happens in kprobe() and uprobe() and so
is not necessary.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

link: remove unused perfEvent.group and name

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

internal: make PlatformPrefix a compile time constant

Refactor the function so that the Go compiler can figure out that it really
is a compile time constant.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

lmb added 6 commits April 26, 2023 16:52
Refactor the function so that the Go compiler can figure out that
it really is a compile time constant.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Remove perfEvent.typ, since the only use is a check against
prog.Type() in attachPerfEvent. This check already happens
in kprobe() and uprobe() and so is not necessary.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
The cookie field is only used to pass a parameter to the perfEventAttach
function. Remove it from perfEvent and pass the cookie directly.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
We currently set a finalizer in attachPerfEventLink and attachPerfEventIoctl.
Instead always set a finalizer on the perfEvent to ensure that we close
perf event and tracefs event in the right order.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb marked this pull request as ready for review April 26, 2023 16:33
@lmb lmb merged commit 8325a9e into cilium:master May 15, 2023
@lmb lmb deleted the tracefs-cleanups branch May 15, 2023 10:17
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.

None yet

1 participant