-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rs
77 lines (68 loc) · 2.1 KB
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR)
// SPDX-License-Identifier: Apache-2.0
use std::time::SystemTime;
use tbt_segmentation::{
evaluate, generate_toml_output_file, get_best_number_skipped_entries, get_tbt_and_trace,
parse_command_line,
};
fn main() {
let start = SystemTime::now();
/*************
* PARAMETERS
*************/
let arguments = parse_command_line();
/**********************************
* Get best number skipped entries
**********************************/
let (number_skipped_entries, delta_rho_skipped) = get_best_number_skipped_entries(
&arguments.specification,
&arguments.logfile,
arguments.sub_sampling,
);
/*******************
* STARTUP ROUTINES
*******************/
let (trace, tbt) = get_tbt_and_trace(
&arguments.specification,
&arguments.logfile,
number_skipped_entries,
arguments.lazy_evaluation,
arguments.sub_sampling,
);
/*********************
* Evaluation
*********************/
let (best_segmentation, alternative_segmentations) = evaluate(
tbt,
trace,
start,
arguments.sub_sampling,
arguments.lazy_evaluation,
delta_rho_skipped,
arguments.print_leaf_segments_only,
arguments.segmentation_setting,
arguments.debug_console,
);
/*********************
* Create XML file
*********************/
if let Some(toml_output_location) = arguments.toml {
println!("Generating toml file: {}", toml_output_location);
match generate_toml_output_file(
toml_output_location,
number_skipped_entries,
best_segmentation,
alternative_segmentations,
) {
Ok(_) => println!("Successfully generated toml file."),
Err(_) => println!("Failed to generate toml file."),
};
}
/*********************
* Finish Execution
*********************/
println!(
"Finished after {} seconds.",
start.elapsed().unwrap().as_secs()
);
}