Skip to content

Add graph plotting for dudect analysis #247

New issue

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

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

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SimonLiu423
Copy link
Contributor

Implement graph generation using "gnuplot" for dudect to visualize t-statistic measurements.

  • Add "plot.c" and "plot.h" files to support graphing, "plot.c" stores each measurements execution time in "data_buffer". When plot_graph() is called, stores the data to file and generates a "gnuplot" script. I try to replicate the graph shown in "dudect's" paper "Dude, is my code constant time?".

  • Modify "fixture.c" to integrate with new plotting functionality.

  • Move definition of ENOUGH_MEASURE and TEST_TRIES from "fixture.c" to "fixture.h" for "plot.c" to access and specify size of "data_buffer"

  • Update "Makefile" to include plot.o in build

This enhancement allows visual representation of constant-time analysis results, making it easier to interpret dudect test outcomes.

Implement graph generation using "gnuplot" for dudect to visualize
t-statistic measurements.

- Add "plot.c" and "plot.h" files to support graphing, "plot.c"
  stores each measurements execution time in "data_buffer". When
  plot_graph() is called, stores the data to file and generates
  a "gnuplot" script. I try to replicate the graph shown in "dudect's"
  paper "Dude, is my code constant time?".

- Modify "fixture.c" to integrate with new plotting functionality.

- Move definition of ENOUGH_MEASURE and TEST_TRIES from "fixture.c" to
  "fixture.h" for "plot.c" to access and specify size of "data_buffer"

- Update "Makefile" to include plot.o in build

This enhancement allows visual representation of constant-time
analysis results, making it easier to interpret dudect test outcomes.

Change-Id: I94387b44010e4b410475c346864d784bdb75251d
@SimonLiu423 SimonLiu423 marked this pull request as draft March 9, 2025 08:33
@SimonLiu423
Copy link
Contributor Author

TODO:

  • detect if gnuplot is installed on machine
  • update github workflow to add support for plotting
  • combine multiple plots into one single image

Known Issue:

  • While generating the gnuplot script, sprintf is used to dynamically set the label. It is a command provided by gnuplot. However, the pre-commit.hook would stop us from committing since sprintf is detected to be a dangerous function.

@jserv
Copy link
Contributor

jserv commented Mar 9, 2025

the pre-commit.hook would stop us from committing since sprintf is detected to be a dangerous function.

You can send another pull request which limits the detection of sprintf only to C source files.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants