Loading libmeminfo/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ cc_defaults { cc_library { name: "libmeminfo", host_supported: true, defaults: ["libmeminfo_defaults"], export_include_dirs: ["include"], export_shared_lib_headers: ["libbase"], Loading libmeminfo/tools/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ cc_binary { cc_binary { name: "showmap", host_supported: true, cflags: [ "-Wall", "-Werror", Loading libmeminfo/tools/showmap.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <sys/signal.h> #include <sys/types.h> #include <unistd.h> Loading Loading @@ -56,7 +57,7 @@ static pid_t g_pid = -1; static VmaInfo g_total; static std::vector<VmaInfo> g_vmas; [[noreturn]] static void usage(int exit_status) { [[noreturn]] static void usage(const char* progname, int exit_status) { fprintf(stderr, "%s [-aqtv] [-f FILE] PID\n" "-a\taddresses (show virtual memory map)\n" Loading @@ -64,7 +65,7 @@ static std::vector<VmaInfo> g_vmas; "-t\tterse (show only items with private pages)\n" "-v\tverbose (don't coalesce maps with the same name)\n" "-f\tFILE (read from input from FILE instead of PID)\n", getprogname()); progname); exit(exit_status); } Loading Loading @@ -239,22 +240,22 @@ int main(int argc, char* argv[]) { g_filename = optarg; break; case 'h': usage(EXIT_SUCCESS); usage(argv[0], EXIT_SUCCESS); default: usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } } if (g_filename.empty()) { if ((argc - 1) < optind) { fprintf(stderr, "Invalid arguments: Must provide <pid> at the end\n"); usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } g_pid = atoi(argv[optind]); if (g_pid <= 0) { fprintf(stderr, "Invalid process id %s\n", argv[optind]); usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } g_filename = ::android::base::StringPrintf("/proc/%d/smaps", g_pid); Loading Loading
libmeminfo/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ cc_defaults { cc_library { name: "libmeminfo", host_supported: true, defaults: ["libmeminfo_defaults"], export_include_dirs: ["include"], export_shared_lib_headers: ["libbase"], Loading
libmeminfo/tools/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ cc_binary { cc_binary { name: "showmap", host_supported: true, cflags: [ "-Wall", "-Werror", Loading
libmeminfo/tools/showmap.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <sys/signal.h> #include <sys/types.h> #include <unistd.h> Loading Loading @@ -56,7 +57,7 @@ static pid_t g_pid = -1; static VmaInfo g_total; static std::vector<VmaInfo> g_vmas; [[noreturn]] static void usage(int exit_status) { [[noreturn]] static void usage(const char* progname, int exit_status) { fprintf(stderr, "%s [-aqtv] [-f FILE] PID\n" "-a\taddresses (show virtual memory map)\n" Loading @@ -64,7 +65,7 @@ static std::vector<VmaInfo> g_vmas; "-t\tterse (show only items with private pages)\n" "-v\tverbose (don't coalesce maps with the same name)\n" "-f\tFILE (read from input from FILE instead of PID)\n", getprogname()); progname); exit(exit_status); } Loading Loading @@ -239,22 +240,22 @@ int main(int argc, char* argv[]) { g_filename = optarg; break; case 'h': usage(EXIT_SUCCESS); usage(argv[0], EXIT_SUCCESS); default: usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } } if (g_filename.empty()) { if ((argc - 1) < optind) { fprintf(stderr, "Invalid arguments: Must provide <pid> at the end\n"); usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } g_pid = atoi(argv[optind]); if (g_pid <= 0) { fprintf(stderr, "Invalid process id %s\n", argv[optind]); usage(EXIT_FAILURE); usage(argv[0], EXIT_FAILURE); } g_filename = ::android::base::StringPrintf("/proc/%d/smaps", g_pid); Loading