hreinecke / sg3_utils

Deprecated git-svn mirror for sg3_utils
http://sg.danny.cz/sg/sg3_utils.html
Other
155 stars 91 forks source link

sg_logs - application client - how to add custom log to 0xf log page #61

Open Klubenn opened 4 years ago

Klubenn commented 4 years ago

As I understood from man and SCSI Commands Reference Manual SCSI devices have reserved place for client logs. Man pages tell very briefly how to use it:

The Application Client log page has 64 log parameters with parameters codes 0 to 63.
Each can hold 252 bytes of user binary data. That 252 bytes (or less) of user data, with
a 4 byte prefix (for a total of 256 bytes) can be provided with the --in=FN option. A
typical prefix would be '0,n,83,fc'. The "n" is the parameter code in hex so the last log
parameter would be '0,3f,83,fc'. That log parameter could be read back at some later
time with '--page=0xf --filter=0x<n>'.

I tried various combinations with sg_logs command, but never succeeded to write anything into that memory.

Could you please give an example what flags to the command to give and what is the structure of the message that has to be sent.

I tried this:

sg_logs --in=- --page=0xf --select /dev/sda -s
0 0 83 fc aa bb cc dd

aa bb cc dd is what I wanted to be written to the log page