diff --git a/src/plugins/markdown-report/Report_markdown.mli b/src/plugins/markdown-report/Report_markdown.mli index 5f38b40b369bc01929f1b544836795f2e5b55057..1359dd68361d4dd49af8335dfad508d5a5bef68b 100644 --- a/src/plugins/markdown-report/Report_markdown.mli +++ b/src/plugins/markdown-report/Report_markdown.mli @@ -13,6 +13,9 @@ module Gen_draft: Parameter_sig.Bool (** Value of [-mdr-remarks]. *) module Remarks: Parameter_sig.String +(** Value of [-mdr-flamegraph]. *) +module FlameGraph: Parameter_sig.String + (** Value of [-mdr-authors]. *) module Authors: Parameter_sig.String_list diff --git a/src/plugins/markdown-report/md_gen.ml b/src/plugins/markdown-report/md_gen.ml index 3e1f753d7d825faae32456aee099d2d6da3b8085..4b6479fc01468ec08e9f37e102b9768c32af0905 100644 --- a/src/plugins/markdown-report/md_gen.ml +++ b/src/plugins/markdown-report/md_gen.ml @@ -411,26 +411,30 @@ let gen_section_alarms is_draft = H1 (plain "Results of the analysis", Some "alarms") :: text_content let gen_section_callgraph is_draft = - let content = - if is_draft then - Comment - "flamegraph allow to visualize the functions and callstacks \ - whose analysis is the most costly." - :: insert_marks - else - [ - Block [ - Text [ - Plain "The image below shows the flamegraph ("; - plain_link "http://www.brendangregg.com/flamegraphs.html"; - Plain ") for the chosen entry point." - ] - ]; - Block - [ Text [Image ("flamegraph", "../server.flamegraph.svg")] ] - ] - in - H1 (plain "Flamegraph", Some "flamegraph") :: content + let f = Mdr_params.FlameGraph.get () in + if f = "" then [] + else begin + let content = + if is_draft then + Comment + "A flamegraph provides a visualization of the functions and callstacks \ + whose analysis is the most costly." + :: insert_marks + else + [ + Block [ + Text [ + Plain "The image below shows the flamegraph ("; + plain_link "http://www.brendangregg.com/flamegraphs.html"; + Plain ") for the chosen entry point." + ] + ]; + Block + [ Text [Image ("flamegraph", f)] ] + ] + in + H1 (plain "Flamegraph", Some "flamegraph") :: content + end let gen_section_postlude is_draft = if is_draft then diff --git a/src/plugins/markdown-report/mdr_params.ml b/src/plugins/markdown-report/mdr_params.ml index 0a576f7ad4cef316edcf003a4e34c5007d4d950f..cc2b0d1f774acc86f98e64071094a0970766ce72 100644 --- a/src/plugins/markdown-report/mdr_params.ml +++ b/src/plugins/markdown-report/mdr_params.ml @@ -39,6 +39,17 @@ struct end ) +module FlameGraph = Empty_string( +struct + let option_name = "-mdr-flamegraph" + let arg_name = "f" + let help = + "reads file <f> to include a FlameGraph (https://github.com/brendangregg/FlameGraph.git),\ + allowing the most analysis-intensive callstacks to be identified\ + quickly and accurately" +end +) + module Authors = String_list( struct let option_name = "-mdr-authors" diff --git a/src/plugins/markdown-report/mdr_params.mli b/src/plugins/markdown-report/mdr_params.mli index 1809a56e844934e8002024377331e11322b10ccb..9671bc092fbe276ef8e0281a3e8d60f8fc8b4fc8 100644 --- a/src/plugins/markdown-report/mdr_params.mli +++ b/src/plugins/markdown-report/mdr_params.mli @@ -12,6 +12,9 @@ module Gen_draft: Parameter_sig.Bool (** Value of [-mdr-remarks]. *) module Remarks: Parameter_sig.String +(** Value of [-mdr-flamegraph]. *) +module FlameGraph: Parameter_sig.String + (** Value of [-mdr-authors]. *) module Authors: Parameter_sig.String_list