[starvation] suppress the number of reports suppressed

Summary:
Currently, if there are several reports on the same line, the most important one is reported together with a message containing how many reports were suppressed.
This is sometimes causing the bug hash we use believe that a report is introduced (eg if the number of suppressed reports changes).

Reviewed By: mbouaziz

Differential Revision: D13067306

fbshipit-source-id: 1cc0c6d3a
master
Nikos Gorogiannis 6 years ago committed by Facebook Github Bot
parent c8c895dbc0
commit b5094cda9b

@ -231,11 +231,10 @@ end = struct
if Reporting.is_suppressed tenv pdesc issue_type then () if Reporting.is_suppressed tenv pdesc issue_type then ()
else Reporting.log_issue_external pname Exceptions.Error ~loc ~ltr issue_type message else Reporting.log_issue_external pname Exceptions.Error ~loc ~ltr issue_type message
in in
let mk_deduped_report reports ({message} as report) = let mk_deduped_report ({message} as report) =
{ report with { report with
message= message= Printf.sprintf "%s Additional report(s) on the same line were suppressed." message
Printf.sprintf "%s %d more report(s) on the same line suppressed." message }
(List.length reports - 1) }
in in
let log_reports compare loc = function let log_reports compare loc = function
| [] -> | [] ->
@ -244,7 +243,7 @@ end = struct
log_report loc report log_report loc report
| reports -> | reports ->
List.max_elt ~compare reports List.max_elt ~compare reports
|> Option.iter ~f:(fun (_, rep) -> mk_deduped_report reports rep |> log_report loc) |> Option.iter ~f:(fun (_, rep) -> mk_deduped_report rep |> log_report loc)
in in
let filter_map_deadlock = function {problem= Deadlock l} as r -> Some (l, r) | _ -> None in let filter_map_deadlock = function {problem= Deadlock l} as r -> Some (l, r) | _ -> None in
let filter_map_starvation = function let filter_map_starvation = function

Loading…
Cancel
Save