Commit cda80d84 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1135 from palmtenor/unsigned_addr

Use uintptr_t for addresses in C++ API
parents bd62f6c9 7524fca5
...@@ -215,7 +215,7 @@ private: ...@@ -215,7 +215,7 @@ private:
std::string name_; std::string name_;
std::string probe_func_; std::string probe_func_;
std::vector<intptr_t> addresses_; std::vector<uintptr_t> addresses_;
std::string program_text_; std::string program_text_;
......
...@@ -91,8 +91,8 @@ BPFStackTable::~BPFStackTable() { ...@@ -91,8 +91,8 @@ BPFStackTable::~BPFStackTable() {
bcc_free_symcache(it.second, it.first); bcc_free_symcache(it.second, it.first);
} }
std::vector<intptr_t> BPFStackTable::get_stack_addr(int stack_id) { std::vector<uintptr_t> BPFStackTable::get_stack_addr(int stack_id) {
std::vector<intptr_t> res; std::vector<uintptr_t> res;
stacktrace_t stack; stacktrace_t stack;
if (!lookup(&stack_id, &stack)) if (!lookup(&stack_id, &stack))
return res; return res;
......
...@@ -208,7 +208,7 @@ class BPFHashTable : public BPFTableBase<KeyType, ValueType> { ...@@ -208,7 +208,7 @@ class BPFHashTable : public BPFTableBase<KeyType, ValueType> {
// From src/cc/export/helpers.h // From src/cc/export/helpers.h
static const int BPF_MAX_STACK_DEPTH = 127; static const int BPF_MAX_STACK_DEPTH = 127;
struct stacktrace_t { struct stacktrace_t {
intptr_t ip[BPF_MAX_STACK_DEPTH]; uintptr_t ip[BPF_MAX_STACK_DEPTH];
}; };
class BPFStackTable : public BPFTableBase<int, stacktrace_t> { class BPFStackTable : public BPFTableBase<int, stacktrace_t> {
...@@ -217,7 +217,7 @@ class BPFStackTable : public BPFTableBase<int, stacktrace_t> { ...@@ -217,7 +217,7 @@ class BPFStackTable : public BPFTableBase<int, stacktrace_t> {
: BPFTableBase<int, stacktrace_t>(desc) {} : BPFTableBase<int, stacktrace_t>(desc) {}
~BPFStackTable(); ~BPFStackTable();
std::vector<intptr_t> get_stack_addr(int stack_id); std::vector<uintptr_t> get_stack_addr(int stack_id);
std::vector<std::string> get_stack_symbol(int stack_id, int pid); std::vector<std::string> get_stack_symbol(int stack_id, int pid);
private: private:
......
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