Skip to content

Commit

Permalink
Add a data structure for a fully-constructed Propeller profile
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 699289584
  • Loading branch information
dhoekwater authored and copybara-github committed Nov 26, 2024
1 parent c23b031 commit ea67f4d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions propeller/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,18 @@ cc_library(
],
)

cc_library(
name = "profile",
hdrs = ["profile.h"],
deps = [
":function_chain_info",
":program_cfg",
":propeller_statistics",
"@abseil-cpp//absl/container:btree",
"@llvm-project//llvm:Support",
],
)

########################
# Tests & Test Utils #
########################
Expand Down
24 changes: 24 additions & 0 deletions propeller/profile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef PROPELLER_PROFILE_H_
#define PROPELLER_PROFILE_H_

#include <memory>
#include <vector>

#include "absl/container/btree_map.h"
#include "llvm/ADT/StringRef.h"
#include "propeller/function_chain_info.h"
#include "propeller/program_cfg.h"
#include "propeller/propeller_statistics.h"

namespace propeller {

struct PropellerProfile {
std::unique_ptr<ProgramCfg> program_cfg;
// Layout of functions in each section.
absl::btree_map<llvm::StringRef, std::vector<FunctionChainInfo>>
functions_chain_info_by_section_name;
PropellerStats stats;
};
} // namespace propeller

#endif // PROPELLER_PROFILE_H_

0 comments on commit ea67f4d

Please sign in to comment.