@@ -368,6 +368,8 @@ mod desc {
368368 "either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
369369 pub const parse_linker_plugin_lto: & str =
370370 "either a boolean (`yes`, `no`, `on`, `off`, etc), or the path to the linker plugin" ;
371+ pub const parse_location_detail: & str =
372+ "comma seperated list of location details to track: `file`, `line`, or `column`" ;
371373 pub const parse_switch_with_opt_path: & str =
372374 "an optional path to the profiling data output directory" ;
373375 pub const parse_merge_functions: & str = "one of: `disabled`, `trampolines`, or `aliases`" ;
@@ -484,6 +486,25 @@ mod parse {
484486 }
485487 }
486488
489+ crate fn parse_location_detail ( ld : & mut LocationDetail , v : Option < & str > ) -> bool {
490+ if let Some ( v) = v {
491+ ld. line = false ;
492+ ld. file = false ;
493+ ld. column = false ;
494+ for s in v. split ( ',' ) {
495+ match s {
496+ "file" => ld. file = true ,
497+ "line" => ld. line = true ,
498+ "column" => ld. column = true ,
499+ _ => return false ,
500+ }
501+ }
502+ true
503+ } else {
504+ false
505+ }
506+ }
507+
487508 crate fn parse_opt_comma_list ( slot : & mut Option < Vec < String > > , v : Option < & str > ) -> bool {
488509 match v {
489510 Some ( s) => {
@@ -1152,6 +1173,9 @@ options! {
11521173 "a list LLVM plugins to enable (space separated)" ) ,
11531174 llvm_time_trace: bool = ( false , parse_bool, [ UNTRACKED ] ,
11541175 "generate JSON tracing data file from LLVM data (default: no)" ) ,
1176+ location_detail: LocationDetail = ( LocationDetail :: all( ) , parse_location_detail, [ TRACKED ] ,
1177+ "comma seperated list of location details to be tracked when using caller_location \
1178+ valid options are `file`, `line`, and `column` (default: all)") ,
11551179 ls: bool = ( false , parse_bool, [ UNTRACKED ] ,
11561180 "list the symbols defined by a library crate (default: no)" ) ,
11571181 macro_backtrace: bool = ( false , parse_bool, [ UNTRACKED ] ,
0 commit comments