scsi_fault_injection_test_tool
scsi_fault_injection_test_tool copied to clipboard
Modify scripts to work when scsi is compiled into the kernel rather than in a loadable module
A user has reported issues when attempting to use the scripts:
stap ./temporary_rerr.stp 8 1 17 1 5000747 -g -I ./fault_injection_common_sata/
semantic error: no match while resolving probe point module("*").function("scsi_decide_disposition@drivers/scsi/scsi_error.c")
semantic error: no match while resolving probe point module("*").function("scsi_next_command@drivers/scsi/scsi_lib.c")
semantic error: no match while resolving probe point module("*").function("scsi_dispatch_cmd@drivers/scsi/scsi.c")
Relevant stap -l output is:
stap -l 'kernel.function("scsi_*")' | sort |grep dispatch
kernel.function("scsi_dispatch_cmd@/build/buildd/linux-lts-quantal-3.5.0/drivers/scsi/scsi.c:656")
In this case, the kernel was built with scsi compiled into the kernel rather than in a loadable module. Ideally the script would autodetect this condition and use kernel.function instead of module("*").
@dwalkes is there any update for this issue ? I have met the same issue.
@markshao no, I didn't end up making any changes for this, sorry.
@dwalkes, I'm the freshman for the systemtap , according to your comments. Looks like if we can replace the module(*) with the right module name/kernel function , then it will work , is that right?
@markshao yes it has been a while since I wrote that comment but I believe that is all that is required to do it manually. This was just tracking a feature of the script to do this automagically
I have replace the module(*).function with kernel.function, now I met some compile errors due to the missing variables.
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c: In function ‘function_get_inode’:
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3645:59: error: ‘struct function_get_inode_locals’ has no member named ‘page’
struct page * thispage = (struct page *)(long)THIS->page;
^
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c: In function ‘function_set_sense_buf’:
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3745:65: error: ‘struct function_set_sense_buf_locals’ has no member named ‘cmd’
struct scsi_cmnd * scmd = (struct scsi_cmnd *)(long)THIS->cmd;
^
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3747:39: error: ‘struct function_set_sense_buf_locals’ has no member named ‘result’
scmd->result = (int)(long)THIS->result;
^
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3749:58: error: ‘struct function_set_sense_buf_locals’ has no member named ‘sensekey’
scmd->sense_buffer[2] = (unsigned char)(long)THIS->sensekey;
^
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3751:59: error: ‘struct function_set_sense_buf_locals’ has no member named ‘asc’
scmd->sense_buffer[12] = (unsigned char)(long)THIS->asc;
^
/tmp/stapxaOUM7/stap_8533dc89e8812c5ee2df2963d694c31f_34775_src.c:3752:59: error: ‘struct function_set_sense_buf_locals’ has no member named ‘ascq’
scmd->sense_buffer[13] = (unsigned char)(long)THIS->ascq;
Hi @markshao - I haven't seen this before but a quick search of the systemtap docs hints that you may need to add an
/* unmangled */
pragma comment inside the relevant code block to use with recent versions of Systemtap. It's been a couple years since the last time I tried these scripts :)