This is an archive of the discontinued LLVM Phabricator instance.

Add documentation for sample profiling support.
ClosedPublic

Authored by dnovillo on Apr 16 2014, 1:57 PM.

Details

Summary

This documents the usage of sample profilers with Clang and the
profile format expected by LLVM's optimizers. It also documents the
profile conversion tool used by Linux Perf.

Diff Detail

Event Timeline

Doug, would you be able to take a look at this patch? I wasn't sure if you're the one to review doc patches, but you seemed the best default according to CODE_OWNERS.TXT

Thanks. Diego.

Mostly copy-editing, but some questions too.

docs/UsersManual.rst
1073

Should this be "do not incur a large runtime overhead" ?

1075

"to determine what the most executed ares of the code are."

1078

"and" instead of ",".

1083

"another function `bar`"

1092

"`-gline-tables-only`"

1131–1133

Are you required to use the exact same arguments that you used before, other than the -fprofile-sample-use= argument? Either way, we should say so here.

1149–1150

Is the whitespace required to be a single space, or can it be any sequence of horizontal whitespace? Is any other whitespace allowed than that listed here?

1164

Should "at the prologue" be "in the prologue"?

1165

"how frequently the function is invoked."

1173–1174

What happens if the line is in a different file (eg through macro expansion or inlining)?

1176–1178

... and what is it, in that case? At a guess: "If present, this is a decimal integer representing the value of the DWARF discriminator register."

1180–1181

Decimal integer? Floating point? Something else? Is scientific notation OK? Is hexadecimal OK?

1193–1194

". With" -> ", with"
"frequent call" -> "frequently called"

dnovillo updated this revision to Diff 8744.Apr 22 2014, 2:55 PM
dnovillo edited edge metadata.
  • Review feedback
rsmith added inline comments.Apr 22 2014, 4:08 PM
docs/UsersManual.rst
1126

This will read `perf.data and the binary file ./code`, and emit

1163

Maybe drop the second "lines" here?

dnovillo updated this revision to Diff 8757.Apr 22 2014, 5:33 PM
  • Review feedback.
dnovillo added inline comments.Apr 22 2014, 5:35 PM
docs/UsersManual.rst
1126

Done.

1163

Done.

dnovillo updated this revision to Diff 8758.Apr 22 2014, 5:35 PM
  • Review feedback.
rsmith accepted this revision.Apr 22 2014, 5:52 PM
rsmith added a reviewer: rsmith.

LGTM

This revision is now accepted and ready to land.Apr 22 2014, 5:52 PM
dnovillo closed this revision.Apr 23 2014, 8:33 AM