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]

5686 (automagic printing of global arrays)


This is the patch I have for displaying global arrays that are written but not read.  I still need to add support for arrays with multiple indices and displaying scalars.  (Only tested with artificial testcases thus far:)
% cat tst.stp
global alpha, beta

probe begin {
 alpha["one"] = 10
 alpha["two"] = 20
 beta["one"] = 1
 beta["two"] = 2
}

probe timer.ms(2000) {
  exit ()
}

probe end {
 foreach ([i] in beta)
   printf("%#x ", beta[i])
 exit()
}

% stap tst.stp
alpha[one]=0xa 
alpha[two]=0x14 
0x1 0x2 

Attachment: ,gitdiff
Description: Binary data


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