# Dumping filesystem buffers using dtrace



## Nicolas Masse (Aug 9, 2019)

Hi all,

I recently came across a bug who is corrupting some files on some specific disks. So i'm trying to debug this using dtrace by dumping the content of the different buffers which ends being written on the disk.
The thing is that dumping those buffer is quite difficult because:
- they can be located inside different structure (uio/bufobj/buf/ccb/...).
- each structure could store those buffer in different fields depending on how they where filled, (for example, the struct bio could store information using the bio_data or the bio_ma + bio_ma_offset fields) but I don't fully understand when I should look which fields.
- It seems that sometimes the addresses used are physical addressses, not always bound to a KVA. Is it possible (and how) when i'm in this case to dump the information using dtrace?

Could someone give me some hints about all this?


----------

