Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0e4af67 authored by Tom Cherry's avatar Tom Cherry
Browse files

logwrapper: update benchmark and remove old functions

All of the previous callers have been updated, so we can remove these
old functions.

Test: build
Change-Id: I31597a69635795bacf9bb8054ccf5ffa8089e481
parent 3699dbe2
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -56,10 +56,10 @@ cc_binary {
// ========================================================
// ========================================================


cc_benchmark {
cc_benchmark {
    name: "android_fork_execvp_ext_benchmark",
    name: "logwrap_fork_execvp_benchmark",
    defaults: ["logwrapper_defaults"],
    defaults: ["logwrapper_defaults"],
    srcs: [
    srcs: [
        "android_fork_execvp_ext_benchmark.cpp",
        "logwrap_fork_execvp_benchmark.cpp",
    ],
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libbase",
+0 −21
Original line number Original line Diff line number Diff line
@@ -59,24 +59,3 @@


int logwrap_fork_execvp(int argc, const char* const* argv, int* status, bool forward_signals,
int logwrap_fork_execvp(int argc, const char* const* argv, int* status, bool forward_signals,
                        int log_target, bool abbreviated, const char* file_path);
                        int log_target, bool abbreviated, const char* file_path);

// TODO: Actually deprecate this and the below.
static inline int android_fork_execvp_ext(int argc, char* argv[], int* status, bool ignore_int_quit,
                                          int log_target, bool abbreviated, const char* file_path,
                                          void* unused_opts, int unused_opts_len) {
    (void)ignore_int_quit;
    (void)unused_opts;
    (void)unused_opts_len;
    return logwrap_fork_execvp(argc, argv, status, false, log_target, abbreviated, file_path);
}

/* Similar to above, except abbreviated logging is not available, and if logwrap
 * is true, logging is to the Android system log, and if false, there is no
 * logging.
 */
static inline int android_fork_execvp(int argc, char* argv[], int* status, bool ignore_int_quit,
                                      bool logwrap) {
    (void)ignore_int_quit;
    return logwrap_fork_execvp(argc, argv, status, false, (logwrap ? LOG_ALOG : LOG_NONE), false,
                               nullptr);
}
+1 −3
Original line number Original line Diff line number Diff line
@@ -23,9 +23,7 @@ static void BM_android_fork_execvp_ext(benchmark::State& state) {
    const char* argv[] = {"/system/bin/echo", "hello", "world"};
    const char* argv[] = {"/system/bin/echo", "hello", "world"};
    const int argc = 3;
    const int argc = 3;
    while (state.KeepRunning()) {
    while (state.KeepRunning()) {
        int rc = android_fork_execvp_ext(
        int rc = logwrap_fork_execvp(argc, argv, nullptr, false, LOG_NONE, false, nullptr);
            argc, (char**)argv, NULL /* status */, false /* ignore_int_quit */, LOG_NONE,
            false /* abbreviated */, NULL /* file_path */, NULL /* opts */, 0 /* opts_len */);
        CHECK_EQ(0, rc);
        CHECK_EQ(0, rc);
    }
    }
}
}