Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get various info about the device internal state and behavior? #8

Closed
dujingwen opened this issue Sep 25, 2018 · 3 comments
Closed

Comments

@dujingwen
Copy link

Hi,
I want to get some values like erase count, device space usage ratio, migration page count during garbage collection , L2P mapping info and so on. But how can I print or view/check this info? Thanks in advance.

@dujingwen dujingwen changed the title How can I get various info about the device internal behavior? How can I get various info about the device internal state and behavior? Sep 25, 2018
@WaterccL
Copy link

The struct ssdstate consists of written_page number.

     /* SSD Util */
    double ssd_util;
    int64_t written_page_nb;

    /* Mapping table */
    int64_t *mapping_table;

If you want to print such information, you may need to modify the source code and recompile it.

@theanoli
Copy link

theanoli commented Jul 10, 2020

It seems the ssdstate struct isn't around anymore (and I can't find a page write counter elsewhere). If I wanted to track the number of page writes, would it be best to put the counter in the NANDFlashState struct, and then increment the counter in the nand_blk_write_ function (here)?

@huaicheng
Copy link
Contributor

Hi,

You might want to check code under hw/block/femu/ftl/. The ideal place to add the counter you need is ssd_advance_status(), which is called every time a NAND level I/O needs to be triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants