blob: 8db23a94f4f8f3c1fb5fac3b5242085a8a357fc9 [file] [log] [blame]
Colin Crossf45fa6b2012-03-26 12:38:26 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Felipe Leme8268ed22016-08-02 18:18:25 -070017#ifndef FRAMEWORK_NATIVE_CMD_DUMPSTATE_H_
18#define FRAMEWORK_NATIVE_CMD_DUMPSTATE_H_
Colin Crossf45fa6b2012-03-26 12:38:26 -070019
20#include <time.h>
21#include <unistd.h>
Colin Cross0c22e8b2012-11-02 15:46:56 -070022#include <stdbool.h>
Colin Crossf45fa6b2012-03-26 12:38:26 -070023#include <stdio.h>
Felipe Leme30dbfa12016-09-02 12:43:26 -070024
25#include <string>
Felipe Leme36b3f6f2015-11-19 15:41:04 -080026#include <vector>
Colin Crossf45fa6b2012-03-26 12:38:26 -070027
Felipe Lemec6bc8bc2016-10-27 15:58:27 -070028#include <android-base/macros.h>
Jiyong Parkb22e65d2017-06-23 21:23:16 +090029#include <android/os/IDumpstateListener.h>
30#include <utils/StrongPointer.h>
Felipe Lemec6bc8bc2016-10-27 15:58:27 -070031#include <ziparchive/zip_writer.h>
32
Felipe Lemebda15a02016-11-16 17:48:25 -080033#include "DumpstateUtil.h"
Felipe Leme75876a22016-10-27 16:31:27 -070034
Felipe Leme35c94f32016-08-12 10:51:54 -070035// Workaround for const char *args[MAX_ARGS_ARRAY_SIZE] variables until they're converted to
36// std::vector<std::string>
Felipe Leme30dbfa12016-09-02 12:43:26 -070037// TODO: remove once not used
Felipe Leme35c94f32016-08-12 10:51:54 -070038#define MAX_ARGS_ARRAY_SIZE 1000
39
Felipe Leme47e9be22016-12-21 15:37:07 -080040// TODO: move everything under this namespace
41// TODO: and then remove explicitly android::os::dumpstate:: prefixes
42namespace android {
43namespace os {
44namespace dumpstate {
45
46class DumpstateTest;
47class ProgressTest;
48
49} // namespace dumpstate
50} // namespace os
51} // namespace android
52
Jiyong Parkb22e65d2017-06-23 21:23:16 +090053class ZipWriter;
54
Felipe Leme30dbfa12016-09-02 12:43:26 -070055// TODO: remove once moved to HAL
Felipe Leme8620bb42015-11-10 11:04:45 -080056#ifdef __cplusplus
57extern "C" {
58#endif
59
Felipe Leme30dbfa12016-09-02 12:43:26 -070060/*
Felipe Leme30dbfa12016-09-02 12:43:26 -070061 * Helper class used to report how long it takes for a section to finish.
62 *
63 * Typical usage:
64 *
65 * DurationReporter duration_reporter(title);
66 *
67 */
68class DurationReporter {
69 public:
Felipe Leme46b85da2016-11-21 17:40:45 -080070 DurationReporter(const std::string& title, bool log_only = false);
Felipe Leme30dbfa12016-09-02 12:43:26 -070071
72 ~DurationReporter();
73
Felipe Leme30dbfa12016-09-02 12:43:26 -070074 private:
Felipe Leme678727a2016-09-21 17:22:11 -070075 std::string title_;
Felipe Leme46b85da2016-11-21 17:40:45 -080076 bool log_only_;
Felipe Lemeb0f669d2016-09-26 18:26:11 -070077 uint64_t started_;
Felipe Leme062926e2016-10-27 15:51:12 -070078
79 DISALLOW_COPY_AND_ASSIGN(DurationReporter);
Felipe Leme30dbfa12016-09-02 12:43:26 -070080};
81
82/*
Felipe Leme7447d7c2016-11-03 18:12:22 -070083 * Keeps track of current progress and estimated max, saving stats on file to tune up future runs.
Felipe Leme71bbfc52015-11-23 14:14:51 -080084 *
Felipe Leme7447d7c2016-11-03 18:12:22 -070085 * Each `dumpstate` section contributes to the total weight by an individual weight, so the overall
86 * progress can be calculated by dividing the estimate max progress by the current progress.
Felipe Leme71bbfc52015-11-23 14:14:51 -080087 *
Felipe Leme7447d7c2016-11-03 18:12:22 -070088 * The estimated max progress is initially set to a value (`kDefaultMax) defined empirically, but
89 * it's adjusted after each dumpstate run by storing the average duration in a file.
Felipe Lemead5f6c42015-11-30 14:26:46 -080090 *
Felipe Leme71bbfc52015-11-23 14:14:51 -080091 */
Felipe Leme7447d7c2016-11-03 18:12:22 -070092class Progress {
Felipe Leme47e9be22016-12-21 15:37:07 -080093 friend class android::os::dumpstate::ProgressTest;
94 friend class android::os::dumpstate::DumpstateTest;
Felipe Leme7447d7c2016-11-03 18:12:22 -070095
96 public:
97 /*
98 * Default estimation of the max duration of a bugreport generation.
99 *
100 * It does not need to match the exact sum of all sections, but ideally it should to be slight
101 * more than such sum: a value too high will cause the bugreport to finish before the user
102 * expected (for example, jumping from 70% to 100%), while a value too low will cause the
103 * progress to get stuck at an almost-finished value (like 99%) for a while.
104 *
105 * This constant is only used when the average duration from previous runs cannot be used.
106 */
107 static const int kDefaultMax;
108
109 Progress(const std::string& path = "");
110
111 // Gets the current progress.
112 int32_t Get() const;
113
114 // Gets the current estimated max progress.
115 int32_t GetMax() const;
116
117 // Gets the initial estimated max progress.
118 int32_t GetInitialMax() const;
119
120 // Increments progress (ignored if not positive).
121 // Returns `true` if the max progress increased as well.
122 bool Inc(int32_t delta);
123
124 // Persist the stats.
125 void Save();
126
127 void Dump(int fd, const std::string& prefix) const;
128
129 private:
130 Progress(int32_t initial_max, float growth_factor,
131 const std::string& path = ""); // Used by test cases.
132 Progress(int32_t initial_max, int32_t progress, float growth_factor); // Used by test cases.
133 void Load();
134 int32_t initial_max_;
135 int32_t progress_;
136 int32_t max_;
137 float growth_factor_;
138 int32_t n_runs_;
139 int32_t average_max_;
140 const std::string& path_;
141};
Felipe Leme71bbfc52015-11-23 14:14:51 -0800142
Felipe Leme71bbfc52015-11-23 14:14:51 -0800143/*
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700144 * List of supported zip format versions.
145 *
146 * See bugreport-format.md for more info.
147 */
Felipe Lemed071c682016-10-20 16:48:00 -0700148static std::string VERSION_CURRENT = "1.0";
149
150/*
Felipe Lemee184f662016-10-27 10:04:47 -0700151 * Temporary version that adds a anr-traces.txt entry. Once tools support it, the current version
Vishnu Nair780b1282017-10-10 13:57:24 -0700152 * will be bumped to 2.0.
Felipe Lemee184f662016-10-27 10:04:47 -0700153 */
Vishnu Nair780b1282017-10-10 13:57:24 -0700154static std::string VERSION_SPLIT_ANR = "2.0-dev-split-anr";
155
156/*
157 * Temporary version that adds priority based dumps. Once tools support it, the current version
158 * will be bumped to 2.0.
159 */
160static std::string VERSION_PRIORITY_DUMPS = "2.0-dev-priority-dumps";
Felipe Lemee184f662016-10-27 10:04:47 -0700161
162/*
Felipe Lemed071c682016-10-20 16:48:00 -0700163 * "Alias" for the current version.
164 */
165static std::string VERSION_DEFAULT = "default";
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700166
167/*
Felipe Lemee844a9d2016-09-21 15:01:39 -0700168 * Main class driving a bugreport generation.
169 *
170 * Currently, it only contains variables that are accessed externally, but gradually the functions
171 * that are spread accross utils.cpp and dumpstate.cpp will be moved to it.
172 */
173class Dumpstate {
Felipe Leme4c2d6632016-09-28 14:32:00 -0700174 friend class DumpstateTest;
175
Felipe Lemee844a9d2016-09-21 15:01:39 -0700176 public:
Felipe Leme47e9be22016-12-21 15:37:07 -0800177 static android::os::dumpstate::CommandOptions DEFAULT_DUMPSYS;
Felipe Lemebda15a02016-11-16 17:48:25 -0800178
Felipe Lemee844a9d2016-09-21 15:01:39 -0700179 static Dumpstate& GetInstance();
Felipe Leme71bbfc52015-11-23 14:14:51 -0800180
Felipe Leme1d486fe2016-10-14 18:06:47 -0700181 /* Checkes whether dumpstate is generating a zipped bugreport. */
182 bool IsZipping() const;
183
Felipe Leme6ad9c062016-09-28 11:58:36 -0700184 /*
Felipe Leme678727a2016-09-21 17:22:11 -0700185 * Forks a command, waits for it to finish, and returns its status.
186 *
187 * |title| description of the command printed on `stdout` (or empty to skip
188 * description).
189 * |full_command| array containing the command (first entry) and its arguments.
190 * Must contain at least one element.
191 * |options| optional argument defining the command's behavior.
192 */
193 int RunCommand(const std::string& title, const std::vector<std::string>& fullCommand,
Felipe Leme47e9be22016-12-21 15:37:07 -0800194 const android::os::dumpstate::CommandOptions& options =
195 android::os::dumpstate::CommandOptions::DEFAULT);
Felipe Leme678727a2016-09-21 17:22:11 -0700196
197 /*
198 * Runs `dumpsys` with the given arguments, automatically setting its timeout
Vishnu Nair6921f802017-11-22 09:17:23 -0800199 * (`-T` argument)
Felipe Leme678727a2016-09-21 17:22:11 -0700200 * according to the command options.
201 *
202 * |title| description of the command printed on `stdout` (or empty to skip
203 * description).
204 * |dumpsys_args| `dumpsys` arguments (except `-t`).
205 * |options| optional argument defining the command's behavior.
Vishnu Nair6921f802017-11-22 09:17:23 -0800206 * |dumpsys_timeout| when > 0, defines the value passed to `dumpsys -T` (otherwise it uses the
Felipe Leme6ad9c062016-09-28 11:58:36 -0700207 * timeout from `options`)
Felipe Leme678727a2016-09-21 17:22:11 -0700208 */
Felipe Leme9a523ae2016-10-20 15:10:33 -0700209 void RunDumpsys(const std::string& title, const std::vector<std::string>& dumpsys_args,
Felipe Leme47e9be22016-12-21 15:37:07 -0800210 const android::os::dumpstate::CommandOptions& options = DEFAULT_DUMPSYS,
Vishnu Nair6921f802017-11-22 09:17:23 -0800211 long dumpsys_timeout_ms = 0);
Felipe Leme678727a2016-09-21 17:22:11 -0700212
213 /*
214 * Prints the contents of a file.
215 *
216 * |title| description of the command printed on `stdout` (or empty to skip
217 * description).
218 * |path| location of the file to be dumped.
219 */
220 int DumpFile(const std::string& title, const std::string& path);
221
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700222 /*
Felipe Leme1d486fe2016-10-14 18:06:47 -0700223 * Adds a new entry to the existing zip file.
224 * */
225 bool AddZipEntry(const std::string& entry_name, const std::string& entry_path);
226
227 /*
228 * Adds a new entry to the existing zip file.
229 */
230 bool AddZipEntryFromFd(const std::string& entry_name, int fd);
231
232 /*
233 * Adds a text entry entry to the existing zip file.
234 */
235 bool AddTextZipEntry(const std::string& entry_name, const std::string& content);
236
237 /*
238 * Adds all files from a directory to the zipped bugreport file.
239 */
240 void AddDir(const std::string& dir, bool recursive);
241
242 /*
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700243 * Takes a screenshot and save it to the given `path`.
244 *
245 * If `path` is empty, uses a standard path based on the bugreport name.
246 */
247 void TakeScreenshot(const std::string& path = "");
248
Felipe Leme7447d7c2016-11-03 18:12:22 -0700249 /////////////////////////////////////////////////////////////////////
250 // TODO: members below should be private once refactor is finished //
251 /////////////////////////////////////////////////////////////////////
252
253 // TODO: temporary method until Dumpstate object is properly set
254 void SetProgress(std::unique_ptr<Progress> progress);
Felipe Lemed80e6b62016-10-03 13:08:14 -0700255
Felipe Leme6f674ae2016-11-18 17:10:33 -0800256 void DumpstateBoard();
257
Felipe Lemed80e6b62016-10-03 13:08:14 -0700258 /*
259 * Updates the overall progress of the bugreport generation by the given weight increment.
260 */
Felipe Leme7447d7c2016-11-03 18:12:22 -0700261 void UpdateProgress(int32_t delta);
Felipe Lemed80e6b62016-10-03 13:08:14 -0700262
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700263 /* Prints the dumpstate header on `stdout`. */
Felipe Leme2b9b06c2016-10-14 09:13:06 -0700264 void PrintHeader() const;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700265
Felipe Leme1d486fe2016-10-14 18:06:47 -0700266 /*
267 * Adds the temporary report to the existing .zip file, closes the .zip file, and removes the
268 * temporary file.
269 */
270 bool FinishZipFile();
271
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700272 /* Gets the path of a bugreport file with the given suffix. */
Felipe Leme2b9b06c2016-10-14 09:13:06 -0700273 std::string GetPath(const std::string& suffix) const;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700274
Vishnu Nair780b1282017-10-10 13:57:24 -0700275 /* Returns true if the current version supports priority dump feature. */
276 bool CurrentVersionSupportsPriorityDumps() const;
277
Felipe Lemee844a9d2016-09-21 15:01:39 -0700278 // TODO: initialize fields on constructor
279
280 // dumpstate id - unique after each device reboot.
Felipe Leme7447d7c2016-11-03 18:12:22 -0700281 uint32_t id_;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700282
Felipe Leme75876a22016-10-27 16:31:27 -0700283 // dumpstate pid
284 pid_t pid_;
285
Felipe Lemee844a9d2016-09-21 15:01:39 -0700286 // Whether progress updates should be published.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700287 bool update_progress_ = false;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700288
Felipe Leme009ecbb2016-11-07 10:18:44 -0800289 // How frequently the progess should be updated;the listener will only be notificated when the
290 // delta from the previous update is more than the threshold.
291 int32_t update_progress_threshold_ = 100;
292
293 // Last progress that triggered a listener updated
294 int32_t last_updated_progress_;
295
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700296 // Whether it should take an screenshot earlier in the process.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700297 bool do_early_screenshot_ = false;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700298
Felipe Leme7447d7c2016-11-03 18:12:22 -0700299 std::unique_ptr<Progress> progress_;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700300
301 // When set, defines a socket file-descriptor use to report progress to bugreportz.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700302 int control_socket_fd_ = -1;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700303
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700304 // Bugreport format version;
Felipe Lemed071c682016-10-20 16:48:00 -0700305 std::string version_ = VERSION_CURRENT;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700306
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700307 // Command-line arguments as string
308 std::string args_;
309
310 // Extra options passed as system property.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700311 std::string extra_options_;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700312
313 // Full path of the directory where the bugreport files will be written.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700314 std::string bugreport_dir_;
Felipe Lemee844a9d2016-09-21 15:01:39 -0700315
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700316 // Full path of the temporary file containing the screenshot (when requested).
Felipe Leme9a523ae2016-10-20 15:10:33 -0700317 std::string screenshot_path_;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700318
319 time_t now_;
320
Felipe Leme2b9b06c2016-10-14 09:13:06 -0700321 // Base name (without suffix or extensions) of the bugreport files, typically
322 // `bugreport-BUILD_ID`.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700323 std::string base_name_;
Felipe Lemebbaf3c12016-10-11 14:32:25 -0700324
Felipe Leme2b9b06c2016-10-14 09:13:06 -0700325 // Name is the suffix part of the bugreport files - it's typically the date (when invoked with
326 // `-d`), but it could be changed by the user..
327 std::string name_;
328
Felipe Leme1d486fe2016-10-14 18:06:47 -0700329 // Full path of the temporary file containing the bugreport.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700330 std::string tmp_path_;
Felipe Leme1d486fe2016-10-14 18:06:47 -0700331
332 // Full path of the file containing the dumpstate logs.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700333 std::string log_path_;
Felipe Leme1d486fe2016-10-14 18:06:47 -0700334
335 // Pointer to the actual path, be it zip or text.
Felipe Leme9a523ae2016-10-20 15:10:33 -0700336 std::string path_;
Felipe Leme1d486fe2016-10-14 18:06:47 -0700337
338 // Pointer to the zipped file.
339 std::unique_ptr<FILE, int (*)(FILE*)> zip_file{nullptr, fclose};
340
Felipe Lemec6bc8bc2016-10-27 15:58:27 -0700341 // Pointer to the zip structure.
342 std::unique_ptr<ZipWriter> zip_writer_;
343
Felipe Leme75876a22016-10-27 16:31:27 -0700344 // Binder object listing to progress.
345 android::sp<android::os::IDumpstateListener> listener_;
346 std::string listener_name_;
347
Naveen Kallab53a1c92017-03-16 18:17:25 -0700348 // Notification title and description
349 std::string notification_title;
350 std::string notification_description;
351
Felipe Lemee844a9d2016-09-21 15:01:39 -0700352 private:
Felipe Lemed80e6b62016-10-03 13:08:14 -0700353 // Used by GetInstance() only.
Felipe Lemef0292972016-11-22 13:57:05 -0800354 Dumpstate(const std::string& version = VERSION_CURRENT);
Felipe Leme062926e2016-10-27 15:51:12 -0700355
356 DISALLOW_COPY_AND_ASSIGN(Dumpstate);
Felipe Lemee844a9d2016-09-21 15:01:39 -0700357};
358
359// for_each_pid_func = void (*)(int, const char*);
360// for_each_tid_func = void (*)(int, int, const char*);
361
362typedef void(for_each_pid_func)(int, const char*);
363typedef void(for_each_tid_func)(int, int, const char*);
Felipe Leme71ca15e2016-05-19 16:18:17 -0700364
Felipe Leme71a74ac2016-03-17 15:43:25 -0700365/* saves the the contents of a file as a long */
366int read_file_as_long(const char *path, long int *output);
367
Christopher Ferris54bcc5f2015-02-10 12:15:01 -0800368/* prints the contents of the fd
369 * fd must have been opened with the flag O_NONBLOCK.
370 */
Christopher Ferris1fe61072014-07-22 16:08:19 -0700371int dump_file_from_fd(const char *title, const char *path, int fd);
Colin Crossf45fa6b2012-03-26 12:38:26 -0700372
Mark Salyzyn326842f2015-04-30 09:49:41 -0700373/* calls skip to gate calling dump_from_fd recursively
374 * in the specified directory. dump_from_fd defaults to
375 * dump_file_from_fd above when set to NULL. skip defaults
376 * to false when set to NULL. dump_from_fd will always be
377 * called with title NULL.
378 */
Felipe Leme678727a2016-09-21 17:22:11 -0700379int dump_files(const std::string& title, const char* dir, bool (*skip)(const char* path),
380 int (*dump_from_fd)(const char* title, const char* path, int fd));
Mark Salyzyn326842f2015-04-30 09:49:41 -0700381
Felipe Leme2628e9e2016-04-12 16:36:51 -0700382/** opens a socket and returns its file descriptor */
383int open_socket(const char *service);
384
Colin Crossf45fa6b2012-03-26 12:38:26 -0700385/* redirect output to a service control socket */
386void redirect_to_socket(FILE *redirect, const char *service);
387
Felipe Leme0f3fb202016-06-10 17:10:53 -0700388/* redirect output to a new file */
Christopher Ferrisff4a4dc2015-02-09 16:24:47 -0800389void redirect_to_file(FILE *redirect, char *path);
Colin Crossf45fa6b2012-03-26 12:38:26 -0700390
Felipe Leme0f3fb202016-06-10 17:10:53 -0700391/* redirect output to an existing file */
392void redirect_to_existing_file(FILE *redirect, char *path);
393
Felipe Leme111b9d02016-02-03 09:28:24 -0800394/* create leading directories, if necessary */
395void create_parent_dirs(const char *path);
396
Jeff Brownbf7f4922012-06-07 16:40:01 -0700397/* dump Dalvik and native stack traces, return the trace file location (NULL if none) */
398const char *dump_traces();
Colin Crossf45fa6b2012-03-26 12:38:26 -0700399
400/* for each process in the system, run the specified function */
Colin Cross0c22e8b2012-11-02 15:46:56 -0700401void for_each_pid(for_each_pid_func func, const char *header);
402
403/* for each thread in the system, run the specified function */
404void for_each_tid(for_each_tid_func func, const char *header);
Colin Crossf45fa6b2012-03-26 12:38:26 -0700405
406/* Displays a blocked processes in-kernel wait channel */
Colin Cross0c22e8b2012-11-02 15:46:56 -0700407void show_wchan(int pid, int tid, const char *name);
Colin Crossf45fa6b2012-03-26 12:38:26 -0700408
Mark Salyzyna297c322016-02-05 15:33:17 -0800409/* Displays a processes times */
410void show_showtime(int pid, const char *name);
411
Colin Crossf45fa6b2012-03-26 12:38:26 -0700412/* Runs "showmap" for a process */
413void do_showmap(int pid, const char *name);
414
415/* Gets the dmesg output for the kernel */
416void do_dmesg();
417
Sreeram Ramachandran2b3bba32014-07-08 15:40:55 -0700418/* Prints the contents of all the routing tables, both IPv4 and IPv6. */
419void dump_route_tables();
420
Colin Crossf45fa6b2012-03-26 12:38:26 -0700421/* Play a sound via Stagefright */
Christopher Ferris1fe61072014-07-22 16:08:19 -0700422void play_sound(const char *path);
Colin Crossf45fa6b2012-03-26 12:38:26 -0700423
Felipe Leme0c80cf02016-01-05 13:25:34 -0800424/* Checks if a given path is a directory. */
425bool is_dir(const char* pathname);
426
427/** Gets the last modification time of a file, or default time if file is not found. */
428time_t get_mtime(int fd, time_t default_mtime);
429
Calvin On249beee2016-06-03 15:17:07 -0700430/* Dumps eMMC Extended CSD data. */
Felipe Leme78f2c862015-12-21 09:55:22 -0800431void dump_emmc_ecsd(const char *ext_csd_path);
432
Calvin On249beee2016-06-03 15:17:07 -0700433/** Gets command-line arguments. */
Felipe Lemea34efb72016-03-11 09:33:32 -0800434void format_args(int argc, const char *argv[], std::string *args);
Felipe Leme88c79332016-02-22 11:06:49 -0800435
Felipe Leme8620bb42015-11-10 11:04:45 -0800436#ifdef __cplusplus
437}
438#endif
439
Felipe Leme8268ed22016-08-02 18:18:25 -0700440#endif /* FRAMEWORK_NATIVE_CMD_DUMPSTATE_H_ */