Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: use /data/local/tmp as temprary dir on Android #2828

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ and this project adheres to
- [#2793](https://github.com/iovisor/bpftrace/pull/2793)
- Fix silent truncation of 64-bit values in hist()
- [#2822](https://github.com/iovisor/bpftrace/pull/2822)
- utils: use /data/local/tmp as temprary dir on Android
- [#2828](https://github.com/iovisor/bpftrace/pull/2828)
#### Docs
#### Tools
- Update runqlen.bt to remove `runnable_weight` field from cfs_rq struct.
Expand Down
4 changes: 4 additions & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,11 @@ namespace {
std::string unpack_kheaders_tar_xz(const struct utsname& utsname)
{
std::error_code ec;
#if defined(__ANDROID__)
std_filesystem::path path_prefix{ "/data/local/tmp" };
#else
std_filesystem::path path_prefix{ "/tmp" };
#endif
std_filesystem::path path_kheaders{ "/sys/kernel/kheaders.tar.xz" };
if (const char* tmpdir = ::getenv("TMPDIR")) {
danobi marked this conversation as resolved.
Show resolved Hide resolved
path_prefix = tmpdir;
Expand Down
Loading