scsi_fault_injection_test_tool icon indicating copy to clipboard operation
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

Open dwalkes opened this issue 11 years ago • 6 comments

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 avatar Feb 10 '14 15:02 dwalkes

@dwalkes is there any update for this issue ? I have met the same issue.

markshao avatar Jan 27 '16 02:01 markshao

@markshao no, I didn't end up making any changes for this, sorry.

dwalkes avatar Jan 27 '16 03:01 dwalkes

@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 avatar Jan 27 '16 06:01 markshao

@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

dwalkes avatar Jan 27 '16 06:01 dwalkes

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;

markshao avatar Jan 27 '16 08:01 markshao

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 :)

dwalkes avatar Jan 28 '16 03:01 dwalkes