This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Type of event in eCos instrumentation record
- From: Nodir Kodirov <nodir dot qodirov at gmail dot com>
- To: John Dallaway <john at dallaway dot org dot uk>
- Cc: Andrew Lunn <andrew at lunn dot ch>, eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 2 Apr 2010 21:45:49 +0900
- Subject: [ECOS] Re: Type of event in eCos instrumentation record
- References: <186ad4051003272348j78632da5y347abb31f50029cc@mail.gmail.com> <20100328083706.GI24782@lunn.ch> <186ad4051003292326t3d18eadrb509422386a70166@mail.gmail.com> <4BB1E540.5000005@dallaway.org.uk>
Thank you John! That worked fine!
Now I have very a simple solution. I use eCos 3.0 and there is
cyg_instrument_msg(CYG_WORD16 type) function defined in
packages/kernel/v3_0/src/instrmnt/meminst.cxx file. This function is
supposed to take *CYG_WORD16 type* of instrumentation event as an
argument and return its string representation, as it is defined at
packages/kernel/v3_0/include/instrument_desc.h.
So, simply
> #include <cyg/kernel/instrument_desc.h>
> #include <cyg/kernel/instrmnt.h>
and
> char * message = cyg_instrument_msg(instrument_buffer[INDEX].type);
we will have a string representation of the instrumentation event.
Once again, a lot of thanks to all for hints!
Regards,
Nodir.
On 30 March 2010 20:49, John Dallaway <john@dallaway.org.uk> wrote:
> Hi Nodir
>
> Nodir Kodirov wrote:
>
>> Now I have two problems.
>> 1) All of the events are "unknown event". instrument_buffer[i].type
>> and instrument_desc[j].num does not match.
>> 2) If you look to struct instrument_desc_s instrument_desc[] there are
>> 125 instrumentation event types and for several event types, it has
>> the same number. So, my print_instr() I am taking the first occurred
>> one, while it is not always correct.
>
> Take at look at the dump_instr.c example code which locates the
> description string within instrument_desc[] in two stages:
>
> http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/kernel/current/host/instr/dump_instr.c?rev=1&content-type=text/x-cvsweb-markup&cvsroot=ecos
>
> I hope this helps...
>
> John Dallaway
> eCos maintainer
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss