Re: [PATCH 6/7] perf tools: Remove 'overwrite' concept from code level
From: Jiri Olsa
Date: Mon Nov 13 2017 - 06:52:36 EST
On Mon, Nov 13, 2017 at 01:38:08AM +0000, Wang Nan wrote:
SNIP
> size_t perf_mmap__mmap_len(struct perf_mmap *map);
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index c129e99..ece33b4 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -856,14 +856,14 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
> PyObject *args, PyObject *kwargs)
> {
> struct perf_evlist *evlist = &pevlist->evlist;
> - static char *kwlist[] = { "pages", "overwrite", NULL };
unlikely, but there might be already some users of this..
I think the best would be to keep the "overwrite" here and
don't use it.. maybe warn or update docs, if there's any ;-)
jirka
> - int pages = 128, overwrite = false;
> + static char *kwlist[] = { "pages", NULL };
> + int pages = 128;
>
> - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ii", kwlist,
> - &pages, &overwrite))
> + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i", kwlist,
> + &pages))
> return NULL;
>
> - if (perf_evlist__mmap(evlist, pages, overwrite) < 0) {
> + if (perf_evlist__mmap(evlist, pages) < 0) {
> PyErr_SetFromErrno(PyExc_OSError);
> return NULL;
> }
> --
> 2.10.1
>