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

Fix tracepoints definitions for Linux 6.10 #16515

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

snajpa
Copy link
Contributor

@snajpa snajpa commented Sep 8, 2024

Motivation and Context

Should fix #16475

Description

New kernels define __assign_str() with only 1 parameter, using the source specified when defining the string field of a tracepoint.

There's one commit of a configure test from @tonyhutter made from this #16475 (comment) comment, it's without a sign-off, so that will probably need @tonyhutter's ack.

Not sure about the best placement (or name) for __assign_str_impl, I've put it into types.h as that was included in trace_dbuf.h so it was the simplest to put it in there and make sure it's included in trace_dbgmsg.h too.

How Has This Been Tested?

Changed META to make tracing available + tested on 6.10, 6.9, 6.8, 5.10, 4.19 kernels.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

tonyhutter and others added 2 commits September 8, 2024 11:21
__string field definition includes the source variable for a value
of the string when the TP hits; in 6.10+ kernels, __assign_str()
uses that to copy a value from src to the string, with older
kernels, __assign_str still accepted src as a second parameter.

Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
@snajpa
Copy link
Contributor Author

snajpa commented Sep 8, 2024

I have a related question to these particular tracepoint definitions - are they even necessary at all? The kernel supports dynamic tracing, a function can be traced at its offset dynamically, with no preexisting static definitions.

Personally, I've never used the predefined probes, I'm always using the dynamic probes on function entry/exit, which require no code to support them from the ZFS side.

Are there any users of the static tracepoints at all? Does it still make sense to carry the definitions around?

I have no idea honestly.

@tonyhutter
Copy link
Contributor

@snajpa I don't know who uses them either...

@wmmur
Copy link

wmmur commented Sep 10, 2024

@robn planned to remove DECLARE_EVENT_CLASS, but @behlendorf decided not to remove DECLARE_EVENT_CLASS. If compilation for kernel linux-rt worked in <=zfs-2.2.6 as it does in zfs-master, no one would notice this error.

@behlendorf
Copy link
Contributor

Are there any users of the static tracepoints at all? Does it still make sense to carry the definitions around?

That's a good point. We've been carrying this code debugging functionality around for a while, and from what I can tell it's lightly used at best. Let's go ahead and merge this compatibility fix to resolve the immediate build issue. Then we can revisit removing it entirely if the consensus is nobody will miss this functionality.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Sep 17, 2024
@behlendorf behlendorf merged commit 90af1e8 into openzfs:master Sep 17, 2024
20 of 23 checks passed
@intelfx
Copy link

intelfx commented Oct 21, 2024

Can this get backported onto 2.2.x please?

darkbasic pushed a commit to darkbasic/zfs that referenced this pull request Oct 27, 2024
__string field definition includes the source variable for a value
of the string when the TP hits; in 6.10+ kernels, __assign_str()
uses that to copy a value from src to the string, with older
kernels, __assign_str still accepted src as a second parameter.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#16475 
Closes openzfs#16515
intelfx pushed a commit to intelfx/zfs that referenced this pull request Oct 28, 2024
__string field definition includes the source variable for a value
of the string when the TP hits; in 6.10+ kernels, __assign_str()
uses that to copy a value from src to the string, with older
kernels, __assign_str still accepted src as a second parameter.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#16475 
Closes openzfs#16515
ptr1337 pushed a commit to CachyOS/zfs that referenced this pull request Nov 14, 2024
__string field definition includes the source variable for a value
of the string when the TP hits; in 6.10+ kernels, __assign_str()
uses that to copy a value from src to the string, with older
kernels, __assign_str still accepted src as a second parameter.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Co-authored-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#16475
Closes openzfs#16515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In-kernel build error: error: macro "__assign_str" passed 2 arguments, but takes just 1
5 participants