This is an archive of the discontinued LLVM Phabricator instance.

[llvm-locstats] Add the --compare option
ClosedPublic

Authored by djtodoro on Dec 25 2019, 12:36 AM.

Details

Summary

Draw a plot showing the difference in debug loc coverage on two
files provided.

Diff Detail

Event Timeline

djtodoro created this revision.Dec 25 2019, 12:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 25 2019, 12:36 AM

An example of the plot on a GDB binary built with LLVM Trunk using the entry values vs. no entry values.

dstenb added a comment.Jan 7 2020, 9:08 AM

Some nits.

llvm/utils/llvm-locstats/llvm-locstats.py
125

spaces around equals for the width parameter.

129

spaces around equals for the width parameter.

333

whoing -> showing ?

How ubiquitous is matplotlib? I wonder if it might be better to textually print out a gnuplot file or something similar. OTOH the surface area in the code seems to be really small, so this may be fine.

djtodoro marked an inline comment as done.Jan 13 2020, 1:21 AM

@aprantl Thanks for the comment, sorry for the late response, I was on the vacation.

How ubiquitous is matplotlib? I wonder if it might be better to textually print out a gnuplot file or something similar. OTOH the surface area in the code seems to be really small, so this may be fine.

I see the matplotlib is used within some of the LLVM Python tools, but I can investigate this further in order to see if the gnuplot is better option for this.

llvm/utils/llvm-locstats/llvm-locstats.py
333

Thanks!

djtodoro updated this revision to Diff 237630.Jan 13 2020, 5:07 AM

-Addressing comments

@aprantl Thanks for the comment, sorry for the late response, I was on the vacation.

How ubiquitous is matplotlib? I wonder if it might be better to textually print out a gnuplot file or something similar. OTOH the surface area in the code seems to be really small, so this may be fine.

I see the matplotlib is used within some of the LLVM Python tools, but I can investigate this further in order to see if the gnuplot is better option for this.

@aprantl For this option I would keep using the matplotlib (there is a help message saying we need the library, please see e.g. clang/utils/analyzer/CmpRuns.py).
Although, I think the gnuplot could be useful as well, but I don't see any obstacle that both ways of plotting coexist here, so we can add another feature to the llvm-locstats tool generating a gnuplot text file. WDYT?

aprantl accepted this revision.Jan 14 2020, 12:30 PM

@aprantl Thanks for the comment, sorry for the late response, I was on the vacation.

How ubiquitous is matplotlib? I wonder if it might be better to textually print out a gnuplot file or something similar. OTOH the surface area in the code seems to be really small, so this may be fine.

I see the matplotlib is used within some of the LLVM Python tools, but I can investigate this further in order to see if the gnuplot is better option for this.

@aprantl For this option I would keep using the matplotlib (there is a help message saying we need the library, please see e.g. clang/utils/analyzer/CmpRuns.py).
Although, I think the gnuplot could be useful as well, but I don't see any obstacle that both ways of plotting coexist here, so we can add another feature to the llvm-locstats tool generating a gnuplot text file. WDYT?

Gnuplot also has a weird license and I don't necessarily want to introduce it as a dependency either. But some form of dumping the raw data that is being graphed into some sort of machine-readable output (perhaps CSV?) could be useful for importing it into other tools like spreadsheets, pgfplot, gnuplot and so on.

This revision is now accepted and ready to land.Jan 14 2020, 12:30 PM

@aprantl Thanks for the comment, sorry for the late response, I was on the vacation.

How ubiquitous is matplotlib? I wonder if it might be better to textually print out a gnuplot file or something similar. OTOH the surface area in the code seems to be really small, so this may be fine.

I see the matplotlib is used within some of the LLVM Python tools, but I can investigate this further in order to see if the gnuplot is better option for this.

@aprantl For this option I would keep using the matplotlib (there is a help message saying we need the library, please see e.g. clang/utils/analyzer/CmpRuns.py).
Although, I think the gnuplot could be useful as well, but I don't see any obstacle that both ways of plotting coexist here, so we can add another feature to the llvm-locstats tool generating a gnuplot text file. WDYT?

Gnuplot also has a weird license and I don't necessarily want to introduce it as a dependency either. But some form of dumping the raw data that is being graphed into some sort of machine-readable output (perhaps CSV?) could be useful for importing it into other tools like spreadsheets, pgfplot, gnuplot and so on.

That sounds like a very good idea! Having something like that will be useful, and we should make a proposal for that. Thanks for the review!

This revision was automatically updated to reflect the committed changes.