From d4b3b69082947e38ea2a6734b352db3909ab279f Mon Sep 17 00:00:00 2001 From: Thierry Strudel Date: Tue, 8 Dec 2015 14:59:46 -0800 Subject: librank: fix pm_memusage_t init and layout pm_memusage_t variables must be initialized to 0 or call initializer. Bug: 26083907 Change-Id: I62882be13de9c546e73bcdc24ec43ed0d5251db1 --- librank/librank.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/librank/librank.c b/librank/librank.c index 28322b9a..5c7c64e7 100644 --- a/librank/librank.c +++ b/librank/librank.c @@ -316,6 +316,7 @@ int main(int argc, char *argv[]) { libraries = malloc(INIT_LIBRARIES * sizeof(struct library_info *)); libraries_count = 0; libraries_size = INIT_LIBRARIES; + pm_memusage_zero(&map_usage); error = pm_kernel_create(&ker); if (error) { @@ -376,7 +377,7 @@ int main(int argc, char *argv[]) { } } - printf(" %6s %6s %6s %6s %6s ", "RSStot", "VSS", "RSS", "PSS", "USS"); + printf(" %6s %7s %6s %6s %6s ", "RSStot", "VSS", "RSS", "PSS", "USS"); if (has_swap) { printf(" %6s ", "Swap"); @@ -390,7 +391,7 @@ int main(int argc, char *argv[]) { for (i = 0; i < libraries_count; i++) { li = libraries[i]; - printf("%6zdK %6s %6s %6s %6s ", li->total_usage.pss / 1024, "", "", "", ""); + printf("%6zdK %7s %6s %6s %6s ", li->total_usage.pss / 1024, "", "", "", ""); if (has_swap) { printf(" %6s ", ""); } @@ -402,7 +403,7 @@ int main(int argc, char *argv[]) { for (j = 0; j < li->mappings_count; j++) { mi = li->mappings[j]; pi = mi->proc; - printf( " %6s %6zdK %6zdK %6zdK %6zdK ", "", + printf( " %6s %7zdK %6zdK %6zdK %6zdK ", "", mi->usage.vss / 1024, mi->usage.rss / 1024, mi->usage.pss / 1024, -- cgit v1.2.3 From e04c0d32ea5e378c381e1541d11cc39af51f04f7 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Thu, 10 Mar 2016 11:49:57 -0800 Subject: simpleperf: check if dwarf callgraph is supported by kernel before testing. Move inclusion of poll.h from header files to source files, as event_selection_set.h is used by cmd_report_test.cpp, which can be built on windows. Bug: 27590546 Change-Id: Ic6b141a93d96610f911ab52da1d927b7f619ccb2 (cherry picked from commit 19e6b6d372a1244189dc2df62313085a61ed1a80) --- simpleperf/cmd_report_test.cpp | 16 +++++++++++----- simpleperf/event_fd.cpp | 1 + simpleperf/event_fd.h | 3 ++- simpleperf/event_selection_set.cpp | 2 ++ simpleperf/event_selection_set.h | 3 ++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/simpleperf/cmd_report_test.cpp b/simpleperf/cmd_report_test.cpp index a5ece01b..e27f71e6 100644 --- a/simpleperf/cmd_report_test.cpp +++ b/simpleperf/cmd_report_test.cpp @@ -24,6 +24,7 @@ #include #include "command.h" +#include "event_selection_set.h" #include "get_test_data.h" #include "read_apk.h" #include "test_util.h" @@ -252,17 +253,22 @@ TEST_F(ReportCommandTest, use_branch_address) { hit_set.end()); } -#if defined(__ANDROID__) || defined(__linux__) +#if defined(__linux__) static std::unique_ptr RecordCmd() { return CreateCommandInstance("record"); } TEST_F(ReportCommandTest, dwarf_callgraph) { - TemporaryFile tmp_file; - ASSERT_TRUE(RecordCmd()->Run({"-g", "-o", tmp_file.path, "sleep", SLEEP_SEC})); - ReportRaw(tmp_file.path, {"-g"}); - ASSERT_TRUE(success); + if (IsDwarfCallChainSamplingSupported()) { + TemporaryFile tmp_file; + ASSERT_TRUE(RecordCmd()->Run({"-g", "-o", tmp_file.path, "sleep", SLEEP_SEC})); + ReportRaw(tmp_file.path, {"-g"}); + ASSERT_TRUE(success); + } else { + GTEST_LOG_(INFO) + << "This test does nothing as dwarf callchain sampling is not supported on this device."; + } } #endif diff --git a/simpleperf/event_fd.cpp b/simpleperf/event_fd.cpp index ec06f6fd..808639bd 100644 --- a/simpleperf/event_fd.cpp +++ b/simpleperf/event_fd.cpp @@ -17,6 +17,7 @@ #include "event_fd.h" #include +#include #include #include #include diff --git a/simpleperf/event_fd.h b/simpleperf/event_fd.h index cc0c0618..c1a7d753 100644 --- a/simpleperf/event_fd.h +++ b/simpleperf/event_fd.h @@ -17,7 +17,6 @@ #ifndef SIMPLE_PERF_EVENT_FD_H_ #define SIMPLE_PERF_EVENT_FD_H_ -#include #include #include @@ -35,6 +34,8 @@ struct PerfCounter { uint64_t id; // The id of the perf_event_file. }; +struct pollfd; + // EventFd represents an opened perf_event_file. class EventFd { public: diff --git a/simpleperf/event_selection_set.cpp b/simpleperf/event_selection_set.cpp index df731f1a..d99966a2 100644 --- a/simpleperf/event_selection_set.cpp +++ b/simpleperf/event_selection_set.cpp @@ -16,6 +16,8 @@ #include "event_selection_set.h" +#include + #include #include diff --git a/simpleperf/event_selection_set.h b/simpleperf/event_selection_set.h index cba9dc62..746abfa7 100644 --- a/simpleperf/event_selection_set.h +++ b/simpleperf/event_selection_set.h @@ -17,7 +17,6 @@ #ifndef SIMPLE_PERF_EVENT_SELECTION_SET_H_ #define SIMPLE_PERF_EVENT_SELECTION_SET_H_ -#include #include #include #include @@ -38,6 +37,8 @@ struct CountersInfo { std::vector counters; }; +struct pollfd; + // EventSelectionSet helps to monitor events. // Firstly, the user creates an EventSelectionSet, and adds the specific event types to monitor. // Secondly, the user defines how to monitor the events (by setting enable_on_exec flag, -- cgit v1.2.3 From 9971a9d02a90e3093e7b3b44b1e67ffb84b7fe0b Mon Sep 17 00:00:00 2001 From: Mohamad Ayyash Date: Wed, 15 Jun 2016 15:53:55 -0700 Subject: mksquashfsimage.sh: Make disable-4k-align a paramter BUG: 29388879 Change-Id: I6ede2273419ba986d08decc0540741c54ed736b1 Signed-off-by: Mohamad Ayyash --- squashfs_utils/mksquashfsimage.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/squashfs_utils/mksquashfsimage.sh b/squashfs_utils/mksquashfsimage.sh index 05ca4e0b..5f45a648 100755 --- a/squashfs_utils/mksquashfsimage.sh +++ b/squashfs_utils/mksquashfsimage.sh @@ -5,7 +5,7 @@ function usage() { cat<