lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141201222919.GC6774@redhat.com>
Date:	Mon, 1 Dec 2014 20:29:19 -0200
From:	Arnaldo Carvalho de Melo <acme@...hat.com>
To:	Jiri Olsa <jolsa@...nel.org>
Cc:	linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 0/8] perf buildid-cache: Add clean command

Em Mon, Dec 01, 2014 at 08:06:21PM +0100, Jiri Olsa escreveu:
> hi,
> adding 'perf buildid-cache clean' command to allow removal
> files from '~/.debug` cache plus other fixes.
> 
> Basically the clean command allows to display/remove cache
> files/sizes like:
> 
> Display cache files older than 3 days:
>   $ perf buildid-cache clean 3d

This is confusing, I went on parsing and the above command meant: clean
the files that are 3 days or older.

Right now we have:

 usage: perf buildid-cache [<options>]

    -a, --add <file list>
                          file(s) to add
    -k, --kcore <file>    kcore file to add
    -r, --remove <file list>
                          file(s) to remove
    -M, --missing <file>  to find missing build ids in the cache
    -f, --force           don't complain, do it
    -u, --update <file list>
                          file(s) to update
    -v, --verbose         be more verbose

[acme@...dy wb]$ 

If we keep the way it is, I think it would be clearer to add a -l/--list
command and that would:

  perf buildid-cache --list  # list all the files in the cache
  perf buildid-cache --list 3d  # list 3 days old files
  perf buildid-cache --list +3d  # list files 3 days or more older
  perf buildid-cache --list -3d  # list files up to 3 days old

And all these would print the sum of the matching files, i.e. the space
those files use in the filesystem.
 
> Remove cache files older than 3 days:
>   $ perf buildid-cache clean 3d -r

  perf buildid-cache --remove [-+]Nd # Same semantics as above

>     
> Total cache removal:
>   $ perf buildid-cache clean -r

 perf buildid-cache --remove '*'
 
> Remove and display items bigger than 200M
>   $ perf buildid-cache clean -r -a 200M

But yeah, perhaps we could switch to having subcommands and add:

  perf buildid-cache [add|remove|update|list]

What do you think?

Also in this process, we should rename buildid-cache to a shorter form,
'cache', i.e. 'perf cache', or we can leave this for later, for Masami's
patchkit we discussed recently.

- Arnaldo
 
> 
> Also available in here:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
>   perf/core_buildid_cache_clean
> 
> thanks,
> jirka
> 
> 
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
> Cc: David Ahern <dsahern@...il.com>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Stephane Eranian <eranian@...gle.com>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> Jiri Olsa (8):
>       perf tools: Use single strcmp call instead of two
>       perf tools: Remove extra debugdir variables
>       perf tools: Add --buildid-dir option to set cache directory
>       perf buildid-cache: Add clean command
>       perf buildid-cache: Add automated tests
>       perf buildid cache: Fix -a segfault
>       perf buildid-cache: Fix kallsyms removal
>       perf buildid-cache: Try to remove empty directories
> 
>  tools/perf/Documentation/perf-buildid-cache.txt |  59 +++++++++++
>  tools/perf/Documentation/perf.txt               |   4 +
>  tools/perf/Makefile.perf                        |   7 +-
>  tools/perf/builtin-buildid-cache.c              | 501 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  tools/perf/perf.c                               |  14 ++-
>  tools/perf/tests/buildid-cache.c                |  88 ++++++++++++++++
>  tools/perf/tests/buildid-cache.sh               |  60 +++++++++++
>  tools/perf/tests/builtin-test.c                 |   8 ++
>  tools/perf/tests/tests.h                        |   1 +
>  tools/perf/util/build-id.c                      |  53 ++++++++--
>  tools/perf/util/config.c                        |  10 +-
>  tools/perf/util/util.h                          |   2 +-
>  12 files changed, 781 insertions(+), 26 deletions(-)
>  create mode 100644 tools/perf/tests/buildid-cache.c
>  create mode 100755 tools/perf/tests/buildid-cache.sh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ