Commit 040df7d3 authored by Vicent Marti's avatar Vicent Marti

cc: Style fixes

parent 10436451
...@@ -31,9 +31,8 @@ ino_t ProcStat::getinode_() { ...@@ -31,9 +31,8 @@ ino_t ProcStat::getinode_() {
return (!stat(procfs_.c_str(), &s)) ? s.st_ino : -1; return (!stat(procfs_.c_str(), &s)) ? s.st_ino : -1;
} }
ProcStat::ProcStat(int pid) : ProcStat::ProcStat(int pid)
procfs_(tfm::format("/proc/%d/exe", pid)), : procfs_(tfm::format("/proc/%d/exe", pid)), inode_(getinode_()) {}
inode_(getinode_()) {}
void KSyms::_add_symbol(const char *symname, uint64_t addr, void *p) { void KSyms::_add_symbol(const char *symname, uint64_t addr, void *p) {
KSyms *ks = static_cast<KSyms *>(p); KSyms *ks = static_cast<KSyms *>(p);
......
...@@ -481,8 +481,8 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { ...@@ -481,8 +481,8 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
rewriter_.ReplaceText( rewriter_.ReplaceText(
SourceRange(Call->getLocStart(), Call->getLocEnd()), text); SourceRange(Call->getLocStart(), Call->getLocEnd()), text);
} else if (Decl->getName() == "bpf_usdt_readarg") { } else if (Decl->getName() == "bpf_usdt_readarg") {
text = "_bpf_readarg_" + current_fn_ + "_" + args[0] + "(" + text = "_bpf_readarg_" + current_fn_ + "_" + args[0] + "(" + args[1] +
args[1] + ", " + args[2] + ", sizeof(*(" + args[2] + ")))"; ", " + args[2] + ", sizeof(*(" + args[2] + ")))";
rewriter_.ReplaceText( rewriter_.ReplaceText(
SourceRange(Call->getLocStart(), Call->getLocEnd()), text); SourceRange(Call->getLocStart(), Call->getLocEnd()), text);
} }
......
...@@ -53,8 +53,8 @@ bool Probe::in_shared_object() { ...@@ -53,8 +53,8 @@ bool Probe::in_shared_object() {
bool Probe::resolve_global_address(uint64_t *global, const uint64_t addr) { bool Probe::resolve_global_address(uint64_t *global, const uint64_t addr) {
if (in_shared_object()) { if (in_shared_object()) {
return (pid_ && !bcc_resolve_global_addr( return (pid_ &&
*pid_, bin_path_.c_str(), addr, global)); !bcc_resolve_global_addr(*pid_, bin_path_.c_str(), addr, global));
} }
*global = addr; *global = addr;
...@@ -162,8 +162,8 @@ bool Probe::usdt_getarg(std::ostream &stream) { ...@@ -162,8 +162,8 @@ bool Probe::usdt_getarg(std::ostream &stream) {
if (locations_.size() == 1) { if (locations_.size() == 1) {
Location &location = locations_.front(); Location &location = locations_.front();
stream << " "; stream << " ";
if (!location.arguments_[arg_n].assign_to_local(stream, cptr, if (!location.arguments_[arg_n].assign_to_local(stream, cptr, bin_path_,
bin_path_, pid_)) pid_))
return false; return false;
stream << "\n return 0;\n}\n"; stream << "\n return 0;\n}\n";
} else { } else {
...@@ -175,8 +175,8 @@ bool Probe::usdt_getarg(std::ostream &stream) { ...@@ -175,8 +175,8 @@ bool Probe::usdt_getarg(std::ostream &stream) {
return false; return false;
tfm::format(stream, " case 0x%xULL: ", global_address); tfm::format(stream, " case 0x%xULL: ", global_address);
if (!location.arguments_[arg_n].assign_to_local(stream, cptr, if (!location.arguments_[arg_n].assign_to_local(stream, cptr, bin_path_,
bin_path_, pid_)) pid_))
return false; return false;
stream << " return 0;\n"; stream << " return 0;\n";
...@@ -211,8 +211,8 @@ void Context::add_probe(const char *binpath, const struct bcc_elf_usdt *probe) { ...@@ -211,8 +211,8 @@ void Context::add_probe(const char *binpath, const struct bcc_elf_usdt *probe) {
} }
} }
probes_.emplace_back(new Probe(binpath, probe->provider, probes_.emplace_back(
probe->name, probe->semaphore, pid_)); new Probe(binpath, probe->provider, probe->name, probe->semaphore, pid_));
probes_.back()->add_location(probe->pc, probe->arg_fmt); probes_.back()->add_location(probe->pc, probe->arg_fmt);
} }
...@@ -282,8 +282,7 @@ Context::Context(int pid) : pid_(pid), pid_stat_(pid), loaded_(false) { ...@@ -282,8 +282,7 @@ Context::Context(int pid) : pid_(pid), pid_stat_(pid), loaded_(false) {
Context::~Context() { Context::~Context() {
if (pid_stat_ && !pid_stat_->is_stale()) { if (pid_stat_ && !pid_stat_->is_stale()) {
for (auto &p : probes_) for (auto &p : probes_) p->disable();
p->disable();
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment