Hi Krishnan,

I'm not sure if this would address the problem, but those are some
pointers to adding new stats.

The main data structure holding Stats object in gem5 is Stats::Group
implemented here
https://gem5.googlesource.com/public/gem5/+/e0441fa7a7c858d7e472fbb1e03089a9a11b8462/src/base/stats/group.hh.
For every Stats object (such as Stats::Scalar, Stats::Formula), it
must be associated with a Stats::Group (note that every SimObject is
also a Stats::Group).
This shows in the constructors of Stats::Scalar and the like, whose
the first parameter is a pointer to a Stats::Group.

This is an example of adding stats to a SimObject:

https://gem5.googlesource.com/public/gem5/+/e0441fa7a7c858d7e472fbb1e03089a9a11b8462/src/arch/x86/tlb.hh#104
https://gem5.googlesource.com/public/gem5/+/e0441fa7a7c858d7e472fbb1e03089a9a11b8462/src/arch/x86/tlb.cc#521

In this example, we created a Stats::Group inside the class whose the
stats, and use the ADD_STAT macro
(https://gem5.googlesource.com/public/gem5/+/e0441fa7a7c858d7e472fbb1e03089a9a11b8462/src/base/stats/group.hh#45)
to associate every Stats object with a Stats::Group.

I hope this is helpful. Please don't hesitate to ask any questions
about adding stats. This helps us improve the documentation about
Stats in gem5.

Regards,
Hoa Nguyen

On 1/25/21, krishnan gosakan via gem5-users <[email protected]> wrote:
> Hi all,
> I am trying to add a few new stat entries for the class Walker available in
> the file pagetable_walker.cc previously, no stas exist for this file. I
> added the function regstats and few stats::scalar variables. When I compile
> and run gem5, I get an error message "panic: Not all stats have been
> initialized. You may need to add <ParentClass>::regStats() to a new
> SimObject's regStats() function." I know I am missing something. Please let
> me know what to do to fix this. Thank you in advance.
>
> --
> Regards,
> Krishnan.
>
_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to