This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Getting at an address...


I am working on trying to track down a potential hot lock used within the QLA device driver, and would like to sue STAP to be able to store the address of a lock held within a structure to match against hot lock addresses being found by lockmeter. I haven't figured out how to get the right syntax to do this. Here's a cut down sample of where I'm at now - what I want is the address of $sp->lun_queue->fclun->fcport->ha->hardware_lock, what follows "works" in that I think I get the address of $sp->lun_queue->fclun->fcport->ha, but I need the deref & offset of hardware_lock instead...

global lun, id, channel, host_no
global lockmap

probe begin
{
       host_no = 0
       channel = 0
       id = 0
       lun = 12
       lockmap = 0
}

function hwl_addr:long (arg:long)
%{
       THIS->__retvalue = (long)&THIS->arg;
%}

probe module("*").function("qla2x00_start_scsi")
{
       if (lockmap != 0) next

       if (lun     != $sp->cmd->device->lun) next
       if (id      != $sp->cmd->device->id) next
       if (channel != $sp->cmd->device->channel) next
       if (host_no != $sp->cmd->device->host->host_no) next

       #ha = $sp->lun_queue->fclun->fcport->ha->hardware_lock
       ha = $sp->lun_queue->fclun->fcport->ha
       lockmap = hwl_addr(ha)
}

probe end
{
printf("(%d, %d, %d, %d) -> %x\n", host_no, channel, id, lun, lockmap)
exit()
}


Thanks for any help!
Alan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]