Page MenuHomeFreeBSD

fusefs: convert debug printfs into dtrace probes
ClosedPublic

Authored by asomers on Mar 21 2019, 12:37 AM.

Details

Summary

fusefs: convert debug printfs into dtrace probes

fuse(4) was heavily instrumented with debug printf statements that could
only be enabled with compile-time flags. They fell into three basic groups:

  1. Totally redundant with dtrace FBT probes. These I deleted.
  2. Print textual information, usually error messages. These I converted to SDT probes of the form fuse:fuse:FILE:trace. They work just like the old printf statements except they can be enabled at runtime with dtrace. They can be filtered by FILE and/or by priority.
  3. More complicated probes that print detailed information. These I converted into ad-hoc SDT probes.

Also, de-inline fuse_internal_cache_attrs.
It's big enough to be a regular function, and this way it gets a dtrace FBT
probe.

This commit is a merge of r345304, r344914, r344703, and r344664 from
projects/fuse2.

Test Plan

extensively tested already on the fuse2 branch

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

asomers created this revision.Mar 21 2019, 12:37 AM
cem added a comment.Mar 23 2019, 7:05 AM

I like the idea of converting the compile time debug prints into Dtrace SBT probes. But I’m not sure what the cache attribute function change has to do with these other logical changes.

In D19667#421605, @cem wrote:

I like the idea of converting the compile time debug prints into Dtrace SBT probes. But I’m not sure what the cache attribute function change has to do with these other logical changes.

You mean the de-inlineing of cache_attrs? I did that so it would get a dtrace fbt probe. I was pretty sure that I would want a probe in that position, and this seems easier and better than adding an SDT probe.

cem added a comment.Mar 23 2019, 7:53 PM

You mean the de-inlineing of cache_attrs? I did that so it would get a dtrace fbt probe. I was pretty sure that I would want a probe in that position, and this seems easier and better than adding an SDT probe.

Yeah. I guess that makes sense. Would it be reasonable to inline the fast path check (don’t cache && null outparam pointer)?

In D19667#421689, @cem wrote:

You mean the de-inlineing of cache_attrs? I did that so it would get a dtrace fbt probe. I was pretty sure that I would want a probe in that position, and this seems easier and better than adding an SDT probe.

Yeah. I guess that makes sense. Would it be reasonable to inline the fast path check (don’t cache && null outparam pointer)?

On reflection, I think I'd rather not. I would have to inline almost half of the function.

asomers updated this revision to Diff 55441.Mar 25 2019, 10:28 PM

update a comment.

Are you ok with this diff as-is, @cem?

cem accepted this revision.Mar 28 2019, 11:00 PM

Sure

This revision is now accepted and ready to land.Mar 28 2019, 11:00 PM
This revision was automatically updated to reflect the committed changes.