lkml.org 
[lkml]   [2016]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH perf/core v10 03/23] perf-buildid: Rename and export build_id_cache__cachedir()
    Date
    Rename and export build_id_cache__cachedir() for retrieving
    use of the path of cache directory for given build_id.

    Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
    ---
    Changes in v10:
    - Splited from "Add --cache option to cache the probe definitions"
    ---
    tools/perf/util/build-id.c | 12 +++++-------
    tools/perf/util/build-id.h | 2 ++
    2 files changed, 7 insertions(+), 7 deletions(-)

    diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
    index 67f986c..ccf0d0d 100644
    --- a/tools/perf/util/build-id.c
    +++ b/tools/perf/util/build-id.c
    @@ -390,9 +390,8 @@ void disable_buildid_cache(void)
    no_buildid_cache = true;
    }

    -static char *build_id_cache__dirname_from_path(const char *name,
    - bool is_kallsyms, bool is_vdso,
    - const char *sbuild_id)
    +char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
    + bool is_kallsyms, bool is_vdso)
    {
    char *realname = (char *)name, *filename;
    bool slash = is_kallsyms || is_vdso;
    @@ -420,8 +419,7 @@ int build_id_cache__list_build_ids(const char *pathname,
    char *dir_name;
    int ret = 0;

    - dir_name = build_id_cache__dirname_from_path(pathname, false, false,
    - NULL);
    + dir_name = build_id_cache__cachedir(NULL, pathname, false, false);
    if (!dir_name)
    return -ENOMEM;

    @@ -447,8 +445,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
    goto out_free;
    }

    - dir_name = build_id_cache__dirname_from_path(name, is_kallsyms,
    - is_vdso, sbuild_id);
    + dir_name = build_id_cache__cachedir(sbuild_id, name,
    + is_kallsyms, is_vdso);
    if (!dir_name)
    goto out_free;

    diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h
    index e5435f4..d8c7f2f 100644
    --- a/tools/perf/util/build-id.h
    +++ b/tools/perf/util/build-id.h
    @@ -30,6 +30,8 @@ bool perf_session__read_build_ids(struct perf_session *session, bool with_hits);
    int perf_session__write_buildid_table(struct perf_session *session, int fd);
    int perf_session__cache_build_ids(struct perf_session *session);

    +char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
    + bool is_kallsyms, bool is_vdso);
    int build_id_cache__list_build_ids(const char *pathname,
    struct strlist **result);
    bool build_id_cache__cached(const char *sbuild_id);
    \
     
     \ /
      Last update: 2016-06-08 12:21    [W:4.720 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site