[config][reporting] add new command line option job-id and log it to EventLogger

Summary:
New command line option job-id meant to contain the Sandcastle job id

itslog

- New command line option job-id meant to contain the ID of the job that Infer is running in
- If the id is passed to infer, then log it with every row in EventLogger

Reviewed By: dulmarod

Differential Revision: D7398537

fbshipit-source-id: c5186e9
master
Varun Arora 7 years ago committed by Facebook Github Bot
parent 690bae30d0
commit f5731ed1bf

@ -1450,6 +1450,8 @@ and java_jar_compiler =
~meta:"path" "Specify the Java compiler jar used to generate the bytecode" ~meta:"path" "Specify the Java compiler jar used to generate the bytecode"
and job_id = CLOpt.mk_string_opt ~long:"job-id" "Specify the job ID of this Infer run."
and jobs = and jobs =
CLOpt.mk_int ~deprecated:["-multicore"] ~long:"jobs" ~short:'j' ~default:ncpu CLOpt.mk_int ~deprecated:["-multicore"] ~long:"jobs" ~short:'j' ~default:ncpu
~in_help:InferCommand.([(Analyze, manual_generic)]) ~in_help:InferCommand.([(Analyze, manual_generic)])
@ -2508,6 +2510,8 @@ and java_jar_compiler = !java_jar_compiler
and javac_classes_out = !javac_classes_out and javac_classes_out = !javac_classes_out
and job_id = !job_id
and jobs = !jobs and jobs = !jobs
and join_cond = !join_cond and join_cond = !join_cond

@ -443,6 +443,8 @@ val java_jar_compiler : string option
val javac_classes_out : string val javac_classes_out : string
val job_id : string option
val jobs : int val jobs : int
val join_cond : int val join_cond : int

@ -316,7 +316,7 @@ module LoggerImpl : S = struct
|> add_string ~key:"hostname" ~data:(Unix.gethostname ()) |> add_string ~key:"hostname" ~data:(Unix.gethostname ())
|> add_string ~key:"infer_commit" ~data:Version.commit |> add_string ~key:"infer_commit" ~data:Version.commit
|> add_int ~key:"is_originator" ~data:(if CLOpt.is_originator then 1 else 0) |> add_int ~key:"is_originator" ~data:(if CLOpt.is_originator then 1 else 0)
|> add_int ~key:"pid" ~data:(pid ()) |> add_string_opt ~key:"job_id" ~data:Config.job_id |> add_int ~key:"pid" ~data:(pid ())
|> add_string ~key:"run_identifier" ~data:(get_log_identifier ()) |> add_string ~key:"run_identifier" ~data:(get_log_identifier ())
|> add_int ~key:"sequence" ~data:(!sequence_ctr - 1) |> add_int ~key:"sequence" ~data:(!sequence_ctr - 1)
|> add_string ~key:"sysname" ~data:sysname |> add_string ~key:"sysname" ~data:sysname

Loading…
Cancel
Save