1

I want to know the amount of bytes Read/Write on MTD char device. What is the way to get it?

It would be OK either via C or terminal.

  • I am mounting the mtd device as embedded device.

  • mtd partitions are done in the SPI flash and it's not mounted. We directly using the /dev/mtdN for read/write.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Selva Kumar
  • 91
  • 1
  • 8
  • How you want to know via c program or just check via terminal? – danglingpointer Jun 02 '17 at 07:39
  • I need the way to find the amount of bytes Write/Read on MTD char device. It ok with either via C or terminal. Please suggest in both the ways. – Selva Kumar Jun 02 '17 at 13:11
  • Are you mounting the mtd device as flash dir in your embedded device? – danglingpointer Jun 02 '17 at 13:26
  • embedded device, mtd partitions are done in the SPI flash and it's not mounted. We directly using the /dev/mtdN for read/write. – Selva Kumar Jun 02 '17 at 13:38
  • I want to the know the amount that has been read/written using MTD char device since the beginning – Selva Kumar Jun 02 '17 at 13:52
  • It is unclear what you are asking. If I write a byte to the MTD then re-write the _same_ byte, is that one byte or two? Are you trying to determine used space or number of accesses? The former is a matter of definition of "used" and format/data structure, and I doubt the latter is intrinsically accounted. Also "since the beginning" of what - since power-up or since the beginning of time? And finally... why? – Clifford Jun 02 '17 at 16:09
  • Here the clear details, hope you aware of how 'iostat' works on block device. As similar to the 'iostat', need to get the Read/Write information for CHAR device (i.e /dev/mtdN) since of the power-up of the system. for example: User writes 10 bytes by 5 time in same location(like re-writing), i expected the output of this trace is 50Bytes. Because, 5 times the write command send to the flash device for each 10Bytes. – Selva Kumar Jun 05 '17 at 05:00
  • Is there any way to trace MTD as char device? – Selva Kumar Jun 07 '17 at 05:11

0 Answers0