diff options
author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2024-11-07 23:52:40 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-11-14 16:56:32 -0300 |
commit | 313026f3ced102a9ef044fbde4a806554ccfe959 (patch) | |
tree | 59b8e277e6e741583b8918dccfd15e6eac194c7b /tools/perf/scripts/python/gecko.py | |
parent | b9e577225c16fae9f5e4d3d642153c64b538c44e (diff) |
perf string: Add strpbrk_esq() and strdup_esq() for escape and quote
strpbrk_esq() and strdup_esq() are new variants for strpbrk() and
strdup() which handles escaped characters and quoted strings.
- strpbrk_esq() searches specified set of characters but ignores the
escaped characters and quoted strings.
e.g. strpbrk_esq("'quote\d' \queue quiz", "qd") returns "quiz".
- strdup_esq() duplicates string but removes backslash and quotes which
is used for quotation. It also keeps the string (including backslash)
in the quoted part.
e.g. strdup_esq("'quote\d' \queue quiz") returns "quote\d queue quiz".
The (single, double) quotes in the quoted part should be escaped by
backslash. In this case, strdup_esq() removes that backslash.
The same quotes must be paired. If you use double quotation, you need
to use the double quotation to close the quoted part.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Dima Kogan <dima@secretsauce.net>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/173099116045.2431889.15772916605719019533.stgit@mhiramat.roam.corp.google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions