Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify scripts to work when scsi is compiled into the kernel rather than in a loadable module #1

Open
dwalkes opened this issue Feb 10, 2014 · 6 comments

Comments

@dwalkes
Copy link
Owner

dwalkes commented Feb 10, 2014

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("*").

@markshao
Copy link

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

@dwalkes
Copy link
Owner Author

dwalkes commented Jan 27, 2016

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

@markshao
Copy link

@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?

@dwalkes
Copy link
Owner Author

dwalkes commented Jan 27, 2016

@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

@markshao
Copy link

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;

@dwalkes
Copy link
Owner Author

dwalkes commented Jan 28, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants