From: Leo Yan <leo.yan@linaro.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Daniel Kiss <daniel.kiss@arm.com>, Denis Nikitin <denik@google.com>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v1 2/3] coresight: tmc-etr: Use perf_output_handle::head for AUX ring buffer Date: Sat, 29 May 2021 00:15:51 +0800 [thread overview] Message-ID: <20210528161552.654907-3-leo.yan@linaro.org> (raw) In-Reply-To: <20210528161552.654907-1-leo.yan@linaro.org> When enable the Arm CoreSight PMU event, the context for AUX ring buffer is prepared in the structure perf_output_handle, and its field "head" points the head of the AUX ring buffer and it is updated after filling AUX trace data into buffer. Current code uses an extra field etr_perf_buffer::head to maintain the header for the AUX ring buffer, thus it's not necessary and it's better to directly perf_output_handle::head. This patch removes the header etr_perf_buffer::head and directly used perf_output_handle::head as the header for AUX ring buffer. Signed-off-by: Leo Yan <leo.yan@linaro.org> --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index acdb59e0e661..b22823d67680 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -32,7 +32,6 @@ struct etr_flat_buf { * @etr_buf - Actual buffer used by the ETR * @pid - The PID this etr_perf_buffer belongs to. * @snaphost - Perf session mode - * @head - handle->head at the beginning of the session. * @nr_pages - Number of pages in the ring buffer. * @pages - Array of Pages in the ring buffer. */ @@ -41,7 +40,6 @@ struct etr_perf_buffer { struct etr_buf *etr_buf; pid_t pid; bool snapshot; - unsigned long head; int nr_pages; void **pages; }; @@ -1437,16 +1435,16 @@ static void tmc_free_etr_buffer(void *config) * buffer to the perf ring buffer. */ static void tmc_etr_sync_perf_buffer(struct etr_perf_buffer *etr_perf, + unsigned long head, unsigned long src_offset, unsigned long to_copy) { long bytes; long pg_idx, pg_offset; - unsigned long head = etr_perf->head; char **dst_pages, *src_buf; struct etr_buf *etr_buf = etr_perf->etr_buf; - head = etr_perf->head; + head = PERF_IDX2OFF(head, etr_perf); pg_idx = head >> PAGE_SHIFT; pg_offset = head & (PAGE_SIZE - 1); dst_pages = (char **)etr_perf->pages; @@ -1553,7 +1551,7 @@ tmc_update_etr_buffer(struct coresight_device *csdev, /* Insert barrier packets at the beginning, if there was an overflow */ if (lost) tmc_etr_buf_insert_barrier_packet(etr_buf, offset); - tmc_etr_sync_perf_buffer(etr_perf, offset, size); + tmc_etr_sync_perf_buffer(etr_perf, handle->head, offset, size); /* * In snapshot mode we simply increment the head by the number of byte @@ -1605,8 +1603,6 @@ static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, void *data) goto unlock_out; } - etr_perf->head = PERF_IDX2OFF(handle->head, etr_perf); - /* * No HW configuration is needed if the sink is already in * use for this session. -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Leo Yan <leo.yan@linaro.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Daniel Kiss <daniel.kiss@arm.com>, Denis Nikitin <denik@google.com>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v1 2/3] coresight: tmc-etr: Use perf_output_handle::head for AUX ring buffer Date: Sat, 29 May 2021 00:15:51 +0800 [thread overview] Message-ID: <20210528161552.654907-3-leo.yan@linaro.org> (raw) In-Reply-To: <20210528161552.654907-1-leo.yan@linaro.org> When enable the Arm CoreSight PMU event, the context for AUX ring buffer is prepared in the structure perf_output_handle, and its field "head" points the head of the AUX ring buffer and it is updated after filling AUX trace data into buffer. Current code uses an extra field etr_perf_buffer::head to maintain the header for the AUX ring buffer, thus it's not necessary and it's better to directly perf_output_handle::head. This patch removes the header etr_perf_buffer::head and directly used perf_output_handle::head as the header for AUX ring buffer. Signed-off-by: Leo Yan <leo.yan@linaro.org> --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index acdb59e0e661..b22823d67680 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -32,7 +32,6 @@ struct etr_flat_buf { * @etr_buf - Actual buffer used by the ETR * @pid - The PID this etr_perf_buffer belongs to. * @snaphost - Perf session mode - * @head - handle->head at the beginning of the session. * @nr_pages - Number of pages in the ring buffer. * @pages - Array of Pages in the ring buffer. */ @@ -41,7 +40,6 @@ struct etr_perf_buffer { struct etr_buf *etr_buf; pid_t pid; bool snapshot; - unsigned long head; int nr_pages; void **pages; }; @@ -1437,16 +1435,16 @@ static void tmc_free_etr_buffer(void *config) * buffer to the perf ring buffer. */ static void tmc_etr_sync_perf_buffer(struct etr_perf_buffer *etr_perf, + unsigned long head, unsigned long src_offset, unsigned long to_copy) { long bytes; long pg_idx, pg_offset; - unsigned long head = etr_perf->head; char **dst_pages, *src_buf; struct etr_buf *etr_buf = etr_perf->etr_buf; - head = etr_perf->head; + head = PERF_IDX2OFF(head, etr_perf); pg_idx = head >> PAGE_SHIFT; pg_offset = head & (PAGE_SIZE - 1); dst_pages = (char **)etr_perf->pages; @@ -1553,7 +1551,7 @@ tmc_update_etr_buffer(struct coresight_device *csdev, /* Insert barrier packets at the beginning, if there was an overflow */ if (lost) tmc_etr_buf_insert_barrier_packet(etr_buf, offset); - tmc_etr_sync_perf_buffer(etr_perf, offset, size); + tmc_etr_sync_perf_buffer(etr_perf, handle->head, offset, size); /* * In snapshot mode we simply increment the head by the number of byte @@ -1605,8 +1603,6 @@ static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, void *data) goto unlock_out; } - etr_perf->head = PERF_IDX2OFF(handle->head, etr_perf); - /* * No HW configuration is needed if the sink is already in * use for this session. -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-28 16:16 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-28 16:15 [PATCH v1 0/3] coresight: Fix for snapshot mode Leo Yan 2021-05-28 16:15 ` Leo Yan 2021-05-28 16:15 ` [PATCH v1 1/3] coresight: etm-perf: Correct buffer syncing for snapshot Leo Yan 2021-05-28 16:15 ` Leo Yan 2021-06-01 9:53 ` James Clark 2021-06-01 9:53 ` James Clark 2021-06-01 10:35 ` Leo Yan 2021-06-01 10:35 ` Leo Yan 2021-06-10 14:54 ` James Clark 2021-06-10 14:54 ` James Clark 2021-06-11 13:55 ` James Clark 2021-06-11 13:55 ` James Clark 2021-06-08 21:41 ` Mathieu Poirier 2021-06-08 21:41 ` Mathieu Poirier 2021-06-09 1:35 ` Leo Yan 2021-06-09 1:35 ` Leo Yan 2021-06-09 1:39 ` Leo Yan 2021-06-09 1:39 ` Leo Yan 2021-05-28 16:15 ` Leo Yan [this message] 2021-05-28 16:15 ` [PATCH v1 2/3] coresight: tmc-etr: Use perf_output_handle::head for AUX ring buffer Leo Yan 2021-06-10 15:38 ` Suzuki K Poulose 2021-06-10 15:38 ` Suzuki K Poulose 2021-05-28 16:15 ` [PATCH v1 3/3] perf cs-etm: Remove callback cs_etm_find_snapshot() Leo Yan 2021-05-28 16:15 ` Leo Yan 2021-06-22 14:29 ` James Clark 2021-06-22 14:29 ` James Clark 2021-06-28 1:31 ` Leo Yan 2021-06-28 1:31 ` Leo Yan 2021-06-24 16:46 ` James Clark 2021-06-24 16:46 ` James Clark 2021-06-10 6:43 ` [PATCH v1 0/3] coresight: Fix for snapshot mode Denis Nikitin 2021-06-10 6:43 ` Denis Nikitin 2021-06-10 16:04 ` Suzuki K Poulose 2021-06-10 16:04 ` Suzuki K Poulose 2021-06-11 8:31 ` Denis Nikitin 2021-06-11 8:31 ` Denis Nikitin 2021-06-12 3:27 ` Leo Yan 2021-06-12 3:27 ` Leo Yan 2021-06-21 8:21 ` Denis Nikitin 2021-06-21 8:21 ` Denis Nikitin 2021-06-22 12:58 ` Leo Yan 2021-06-22 12:58 ` Leo Yan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210528161552.654907-3-leo.yan@linaro.org \ --to=leo.yan@linaro.org \ --cc=acme@kernel.org \ --cc=alexander.shishkin@linux.intel.com \ --cc=coresight@lists.linaro.org \ --cc=daniel.kiss@arm.com \ --cc=denik@google.com \ --cc=john.garry@huawei.com \ --cc=jolsa@redhat.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-perf-users@vger.kernel.org \ --cc=mathieu.poirier@linaro.org \ --cc=mike.leach@linaro.org \ --cc=mingo@redhat.com \ --cc=namhyung@kernel.org \ --cc=peterz@infradead.org \ --cc=suzuki.poulose@arm.com \ --cc=will@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.