On 23 August 2016 at 10:24, liubowen (A) <liubowen2(a)huawei.com> wrote:
> Hi Mathieu,
>
> I am Bob.
>
>
>
> I still get stuck. I feel not good. However, I should move on.
>
> The reason why I fail is as follows.
>
>
>
>
>
> On current station, I work on the board similar to D02 made from
> Hisilicon. And the Image comes from “4.7.0-rc2” into which we have added a
> lot drivers related with the board.
>
>
>
> From the log from git, the latest change about coresight for “4.7.0-rc2”
> is “2016-05-21”. But “perf-opencsd-4.7” has changed a lot after the point
> “2016-05-21”.
>
>
>
>
>
> Maybe ,the problem is here. I make a “perf” executable from
> “perf-opencsd-4.7”, but the coresight drivers used to generate trace data
> aren’t complete. The drivers come from “4.7.0-rc2” not “perf-opencsd-4.7”.
>
>
>
> So, I intend to make a Image from the branch “perf-opencsd-4.7”,
> but there is a lot of work in adding relational drivers with the board. I
> give up this way for the moment.
>
>
>
> So, I want to add complete coresight driver from “perf-opencsd-4.7” into
> “4.7.0-rc2” which I am working on. Can you help me? Can you offer me the
> whole patches about coresight and others necessary?
>
> I have tried to compare the file from the two branches, and make the
> relational files same to the files in “perf-opencsd-4.7” by hand, but it is
> not clever.
>
>
>
> I am sorry to trouble you. I hope my question is clear for you. Howevew,
> thanks very much for your time!!
>
>
>
> Best regards!
>
>
>
> Bob
>
You have found the problem - congratulation. I am working very hard on
upstreaming all the out-of-tree code available on github
(perf-opencsd-4.8-rc1) but it will probably take a few more kernel cycle
before everything finds its way mainline.
I am not sure how else I can help you, or if I can help you at all. All
the code is publicly available and updated with each new kernel cycle.
Best regards,
Mathieu
Hi All,
The first version of draft [1] just finished on google docs, it will
be (I hope) published as the September Core Dump article as we
expected. I tried my best to make the words and sentences in this
documentation clear and correct though, there must be some mistakes I
believe :)
Please have a look and any comments and advices would be greatly appreciated.
I've added a few person in the can-edit list, but I don't know exactly
all email addresses which are in this list, so you may find yourself
don't have the edit authority, if that's the case please let me know,
or you can simply comment on email.
Many thanks,
Chunyan
[1] https://docs.google.com/document/d/16YICrRW4Tm51uU8bMgtJ2hR_VQyEqiTBd4wlA55…
OpenCSD v0.4 provides a more scaleable and generic API for decoder
creation. This patch fixes the cs-etm-decoder in perf report to use
the new API.
Removes the deprecated protocol specific C API function calls used to
create decoders, replacing them with the general create by protocol name
API introduced in OpenCSD v0.4
Fix typename move from C API to more global ocsd_ API types.
Signed-off-by: Mike Leach <mike.leach(a)linaro.org>
---
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 31 +++++++++++++++++++------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index ef36f02..a76109c 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -253,6 +253,7 @@ static int cs_etm_decoder__create_etmv4i_packet_printer(struct cs_etm_decoder_pa
{
ocsd_etmv4_cfg trace_config;
int ret = 0;
+ unsigned char CSID; /* CSID extracted from the config data */
if (d_params->packet_printer == NULL)
return -1;
@@ -264,11 +265,20 @@ static int cs_etm_decoder__create_etmv4i_packet_printer(struct cs_etm_decoder_pa
decoder->packet_printer = d_params->packet_printer;
- ret = ocsd_dt_create_etmv4i_pkt_proc(decoder->dcd_tree,
- &trace_config,
- cs_etm_decoder__etmv4i_packet_printer,
- decoder);
+ ret = ocsd_dt_create_decoder(decoder->dcd_tree,
+ OCSD_BUILTIN_DCD_ETMV4I,
+ OCSD_CREATE_FLG_PACKET_PROC,
+ (void *)&trace_config,
+ &CSID);
+ if (ret != 0)
+ return -1;
+
+ ret = ocsd_dt_attach_packet_callback(decoder->dcd_tree,
+ CSID,
+ OCSD_C_API_CB_PKT_SINK,
+ cs_etm_decoder__etmv4i_packet_printer,
+ decoder);
return ret;
}
@@ -277,6 +287,8 @@ static int cs_etm_decoder__create_etmv4i_packet_decoder(struct cs_etm_decoder_pa
{
ocsd_etmv4_cfg trace_config;
int ret = 0;
+ unsigned char CSID; /* CSID extracted from the config data */
+
decoder->packet_printer = d_params->packet_printer;
ret = cs_etm_decoder__gen_etmv4_config(t_params,&trace_config);
@@ -284,9 +296,13 @@ static int cs_etm_decoder__create_etmv4i_packet_decoder(struct cs_etm_decoder_pa
if (ret != 0)
return -1;
- ret = ocsd_dt_create_etmv4i_decoder(decoder->dcd_tree,&trace_config);
+ ret = ocsd_dt_create_decoder(decoder->dcd_tree,
+ OCSD_BUILTIN_DCD_ETMV4I,
+ OCSD_CREATE_FLG_FULL_DECODER,
+ (void *)&trace_config,
+ &CSID);
- if (ret != OCSD_OK)
+ if (ret != 0)
return -1;
ret = ocsd_dt_set_gen_elem_outfn(decoder->dcd_tree,
@@ -294,6 +310,7 @@ static int cs_etm_decoder__create_etmv4i_packet_decoder(struct cs_etm_decoder_pa
return ret;
}
+
int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder, uint64_t address, uint64_t len, cs_etm_mem_cb_type cb_func)
{
int err;
@@ -312,7 +329,7 @@ int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder, uint64_t a
int cs_etm_decoder__add_bin_file(struct cs_etm_decoder *decoder, uint64_t offset, uint64_t address, uint64_t len, const char *fname)
{
int err = 0;
- file_mem_region_t region;
+ ocsd_file_mem_region_t region;
(void) len;
if (NULL == decoder)
--
2.7.4
On 11 August 2016 at 08:56, liubowen (A) <liubowen2(a)huawei.com> wrote:
> Hi Mathieu:
>
>
>
> I am bob. Thanks for your time.
>
>
>
> Now, I want to enable ETR to store trace messages instead of ETB, of which
> the size is only 16KB. Maybe the size is not large enough, the perf.data is
> not complete, and something goes wrong. And Chunyan Zhang also
>
> suggests me try ETR. Here, many thanks to Chunyan Zhang at the same time.
> ^_^
>
>
>
> What I want is like as follows, CoreSight blocks are listed in the device
> tree for a specifiv system and discovered at boot time.
>
>
>
By the way, what board is this?
> So, I follow the Documentation/devicetree/bindings/arm/coresight.txt
> which is in the kernel. However this doc tells us how to configure the ETB
> without ETR. In fact, ETR is a little more complex.
>
> I tried to configure ETR in the DTS according to the master and slave
> relations among CoreSight blocks, buf failed finally.
>
>
>
> Here , can you show me a DTS demo including the configuration of ETR when
> you are really convenient. I will be very sorry if I do trouble you.
>
>
>
> Thanks for your time!!
>
>
>
> Best Regards,
>
>
>
> Bob
>
Hi,
Thanks for your time!
I am bob. I am interested in the CoreSight Project. And I get much from the web page http://www.linaro.org/blog/core-dump/coresight-perf-and-the-opencsd-library/.
Because I work on ARM64, there is a bug with perf working on ARM. Specific information from https://www.linaro.org/blog/core-dump/debugging-arm-kernels-using-nmifiq/.
For instance, when we run : dd if=/dev/urandom of=/dev/null, over 90% of the CPU time is spent unlocking interrupts and the cryptographic operations that should dominate the
use case are completely hidden.
[cid:image003.jpg@01D1E8DF.C2B9E9D0]
The author Daniel Thompson from Linaro comes up with a primary solution, however he suggests it will need further work.
Now, CoreSight can trace program flow only by hardware. If we combine coresight with perf, when we run “dd if=/dev/urandom of=/dev/null” and perf record, will the report be normal?
If it is normal, it will be amazing!!! And, I am eager for the related information.
I have followed the documentation to enable coresight and perf, but get stuck. I can not figure out whether it is normal.
I greatly appreciate for your help!!! Thanks again for your time!!!
OpenCSD 0v004 provides a more scaleable and generic API for decoder
creation. This patch fixes the cs-etm-decoder in perf report to use
the new API.
Mike Leach (1):
cs-etm: Update to perf cs-etm decode for new C API
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 34 +++++++++++++++++--------
1 file changed, 24 insertions(+), 10 deletions(-)
--
2.7.4