Skip to content

Commit 9827311

Browse files
dhoekwatercopybara-github
authored andcommitted
Add a data structure for a fully-constructed Propeller profile
PiperOrigin-RevId: 700395227
1 parent c23b031 commit 9827311

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

propeller/BUILD

+12
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,18 @@ cc_library(
615615
],
616616
)
617617

618+
cc_library(
619+
name = "profile",
620+
hdrs = ["profile.h"],
621+
deps = [
622+
":function_chain_info",
623+
":program_cfg",
624+
":propeller_statistics",
625+
"@abseil-cpp//absl/container:btree",
626+
"@llvm-project//llvm:Support",
627+
],
628+
)
629+
618630
########################
619631
# Tests & Test Utils #
620632
########################

propeller/profile.h

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef PROPELLER_PROFILE_H_
2+
#define PROPELLER_PROFILE_H_
3+
4+
#include <memory>
5+
#include <vector>
6+
7+
#include "absl/container/btree_map.h"
8+
#include "llvm/ADT/StringRef.h"
9+
#include "propeller/function_chain_info.h"
10+
#include "propeller/program_cfg.h"
11+
#include "propeller/propeller_statistics.h"
12+
13+
namespace propeller {
14+
15+
struct PropellerProfile {
16+
std::unique_ptr<ProgramCfg> program_cfg;
17+
// Layout of functions in each section.
18+
absl::btree_map<llvm::StringRef, std::vector<FunctionChainInfo>>
19+
functions_chain_info_by_section_name;
20+
PropellerStats stats;
21+
};
22+
} // namespace propeller
23+
24+
#endif // PROPELLER_PROFILE_H_

0 commit comments

Comments
 (0)