get rid of $Revision string - sync with 2.2 branch
[ira/wip.git] / pcp / samba.c
1 /*
2  * Samba, configurable PMDA
3  *
4  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it would be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * Further, this software is distributed without any warranty that it is
15  * free of the rightful claim of any third person regarding infringement
16  * or the like.  Any license provided herein, whether implied or
17  * otherwise, applies only to this software file.  Patent licenses, if
18  * any, provided herein do not apply to combinations of this program with
19  * other software, or any other product whatsoever.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write the Free Software Foundation, Inc., 59
23  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
24  *
25  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
26  * Mountain View, CA  94043, or:
27  *
28  * http://www.sgi.com
29  *
30  * For further information regarding this notice, see:
31  *
32  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
33  */
34
35 typedef int BOOL;
36
37 #define IRIX 1
38
39 #include <stdio.h>
40 #include <sys/shm.h>
41 #include <pcp/pmapi.h>
42 #ifdef IRIX
43 #include <pcp/impl.h>
44 #endif
45 #include <pcp/pmda.h>
46 #include "domain.h"
47 #include "profile.h"
48
49 /*
50  * lifted definitions from the samba source
51  */
52
53 #define MAX_OPEN_FILES 10000    /* from local.h */
54
55 /*
56  * all metrics supported in this PMDA - one table entry for each
57  */
58 static pmdaMetric metrictab[] = {
59 /* smbd.smb_count */
60     { NULL, { PMDA_PMID(0,0), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
61                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
62 /* smbd.uid_changes */
63     { NULL, { PMDA_PMID(0,1), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
64                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
65 /* syscalls.opendir */
66     { NULL, { PMDA_PMID(1,2), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
67                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
68 /* syscalls.opendir_time */
69     { NULL, { PMDA_PMID(1,3), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
70                 { 0,1,0,0,PM_TIME_USEC,0} }, },
71 /* syscalls.readdir */
72     { NULL, { PMDA_PMID(1,4), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
73                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
74 /* syscalls.readdir_time */
75     { NULL, { PMDA_PMID(1,5), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
76                 { 0,1,0,0,PM_TIME_USEC,0} }, },
77 /* syscalls.mkdir */
78     { NULL, { PMDA_PMID(1,6), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
79                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
80 /* syscalls.mkdir_time */
81     { NULL, { PMDA_PMID(1,7), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
82                 { 0,1,0,0,PM_TIME_USEC,0} }, },
83 /* syscalls.rmdir */
84     { NULL, { PMDA_PMID(1,8), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
85                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
86 /* syscalls.rmdir_time */
87     { NULL, { PMDA_PMID(1,9), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
88                 { 0,1,0,0,PM_TIME_USEC,0} }, },
89 /* syscalls.closedir */
90     { NULL, { PMDA_PMID(1,10), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
91                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
92 /* syscalls.closedir_time */
93     { NULL, { PMDA_PMID(1,11), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
94                 { 0,1,0,0,PM_TIME_USEC,0} }, },
95 /* syscalls.open */
96     { NULL, { PMDA_PMID(1,12), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
97                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
98 /* syscalls.open_time */
99     { NULL, { PMDA_PMID(1,13), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
100                 { 0,1,0,0,PM_TIME_USEC,0} }, },
101 /* syscalls.close */
102     { NULL, { PMDA_PMID(1,14), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
103                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
104 /* syscalls.close_time */
105     { NULL, { PMDA_PMID(1,15), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
106                 { 0,1,0,0,PM_TIME_USEC,0} }, },
107 /* syscalls.read_count */
108     { NULL, { PMDA_PMID(1,16), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
109                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
110 /* syscalls.read_time */
111     { NULL, { PMDA_PMID(1,17), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
112                 { 0,1,0,0,PM_TIME_USEC,0} }, },
113 /* syscalls.read_bytes */
114     { NULL, { PMDA_PMID(1,18), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
115                 { 1,0,0,PM_SPACE_BYTE,0,0} }, },
116 /* syscalls.write_count */
117     { NULL, { PMDA_PMID(1,19), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
118                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
119 /* syscalls.write_time */
120     { NULL, { PMDA_PMID(1,20), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
121                 { 0,1,0,0,PM_TIME_USEC,0} }, },
122 /* syscalls.write_bytes */
123     { NULL, { PMDA_PMID(1,21), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
124                 { 1,0,0,PM_SPACE_BYTE,0,0} }, },
125 /* syscalls.lseek */
126     { NULL, { PMDA_PMID(1,22), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
127                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
128 /* syscalls.lseek_time */
129     { NULL, { PMDA_PMID(1,23), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
130                 { 0,1,0,0,PM_TIME_USEC,0} }, },
131 /* syscalls.rename */
132     { NULL, { PMDA_PMID(1,24), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
133                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
134 /* syscalls.rename_time */
135     { NULL, { PMDA_PMID(1,25), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
136                 { 0,1,0,0,PM_TIME_USEC,0} }, },
137 /* syscalls.fsync */
138     { NULL, { PMDA_PMID(1,26), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
139                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
140 /* syscalls.fsync_time */
141     { NULL, { PMDA_PMID(1,27), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
142                 { 0,1,0,0,PM_TIME_USEC,0} }, },
143 /* syscalls.stat */
144     { NULL, { PMDA_PMID(1,28), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
145                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
146 /* syscalls.stat_time */
147     { NULL, { PMDA_PMID(1,29), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
148                 { 0,1,0,0,PM_TIME_USEC,0} }, },
149 /* syscalls.fstat */
150     { NULL, { PMDA_PMID(1,30), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
151                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
152 /* syscalls.fstat_time */
153     { NULL, { PMDA_PMID(1,31), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
154                 { 0,1,0,0,PM_TIME_USEC,0} }, },
155 /* syscalls.lstat */
156     { NULL, { PMDA_PMID(1,32), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
157                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
158 /* syscalls.lstat_time */
159     { NULL, { PMDA_PMID(1,33), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
160                 { 0,1,0,0,PM_TIME_USEC,0} }, },
161 /* syscalls.unlink */
162     { NULL, { PMDA_PMID(1,34), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
163                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
164 /* syscalls.unlink_time */
165     { NULL, { PMDA_PMID(1,35), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
166                 { 0,1,0,0,PM_TIME_USEC,0} }, },
167 /* syscalls.chmod */
168     { NULL, { PMDA_PMID(1,36), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
169                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
170 /* syscalls.chmod_time */
171     { NULL, { PMDA_PMID(1,37), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
172                 { 0,1,0,0,PM_TIME_USEC,0} }, },
173 /* syscalls.chown */
174     { NULL, { PMDA_PMID(1,38), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
175                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
176 /* syscalls.chown_time */
177     { NULL, { PMDA_PMID(1,39), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
178                 { 0,1,0,0,PM_TIME_USEC,0} }, },
179 /* syscalls.chdir */
180     { NULL, { PMDA_PMID(1,40), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
181                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
182 /* syscalls.chdir_time */
183     { NULL, { PMDA_PMID(1,41), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
184                 { 0,1,0,0,PM_TIME_USEC,0} }, },
185 /* syscalls.getwd */
186     { NULL, { PMDA_PMID(1,42), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
187                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
188 /* syscalls.getwd_time */
189     { NULL, { PMDA_PMID(1,43), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
190                 { 0,1,0,0,PM_TIME_USEC,0} }, },
191 /* syscalls.utime */
192     { NULL, { PMDA_PMID(1,44), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
193                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
194 /* syscalls.utime_time */
195     { NULL, { PMDA_PMID(1,45), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
196                 { 0,1,0,0,PM_TIME_USEC,0} }, },
197 /* syscalls.ftruncate */
198     { NULL, { PMDA_PMID(1,46), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
199                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
200 /* syscalls.ftruncate_time */
201     { NULL, { PMDA_PMID(1,47), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
202                 { 0,1,0,0,PM_TIME_USEC,0} }, },
203 /* syscalls.fcntl_lock */
204     { NULL, { PMDA_PMID(1,48), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
205                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
206 /* syscalls.fcntl_time */
207     { NULL, { PMDA_PMID(1,49), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
208                 { 0,1,0,0,PM_TIME_USEC,0} }, },
209 /* statcache.lookups */
210     { NULL, { PMDA_PMID(2,50), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
211                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
212 /* statcache.misses */
213     { NULL, { PMDA_PMID(2,51), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
214                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
215 /* statcache.hits */
216     { NULL, { PMDA_PMID(2,52), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
217                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
218 /* writecache.num_caches */
219     { NULL, { PMDA_PMID(3,53), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT, 
220                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
221 /* writecache.allocated_caches */
222     { NULL, { PMDA_PMID(3,54), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT, 
223                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
224 /* writecache.read_hits */
225     { NULL, { PMDA_PMID(3,55), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
226                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
227 /* writecache.total_writes */
228     { NULL, { PMDA_PMID(3,56), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
229                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
230 /* writecache.init_writes */
231     { NULL, { PMDA_PMID(3,57), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
232                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
233 /* writecache.abutted_writes */
234     { NULL, { PMDA_PMID(3,58), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
235                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
236 /* writecache.perfect_writes */
237     { NULL, { PMDA_PMID(3,59), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
238                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
239 /* writecache.direct_writes */
240     { NULL, { PMDA_PMID(3,60), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
241                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
242 /* writecache.non_oplock_writes */
243     { NULL, { PMDA_PMID(3,61), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
244                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
245 /* writecache.seek_flush */
246     { NULL, { PMDA_PMID(3,62), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
247                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
248 /* writecache.read_flush */
249     { NULL, { PMDA_PMID(3,63), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
250                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
251 /* writecache.write_flush */
252     { NULL, { PMDA_PMID(3,64), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
253                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
254 /* writecache.readraw_flush */
255     { NULL, { PMDA_PMID(3,65), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
256                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
257 /* writecache.oplock_rel_flush */
258     { NULL, { PMDA_PMID(3,66), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
259                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
260 /* writecache.close_flush */
261     { NULL, { PMDA_PMID(3,67), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
262                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
263 /* writecache.sync_flush */
264     { NULL, { PMDA_PMID(3,68), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
265                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
266 /* writecache.size_change_flush */
267     { NULL, { PMDA_PMID(3,69), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
268                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
269 /* SMB.SMB_mkdir */
270     { NULL, { PMDA_PMID(4,70), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
271                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
272 /* SMB.SMB_mkdir_time */
273     { NULL, { PMDA_PMID(4,71), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
274                 { 0,1,0,0,PM_TIME_USEC,0} }, },
275 /* SMB.SMB_rmdir */
276     { NULL, { PMDA_PMID(4,72), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
277                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
278 /* SMB.SMB_rmdir_time */
279     { NULL, { PMDA_PMID(4,73), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
280                 { 0,1,0,0,PM_TIME_USEC,0} }, },
281 /* SMB.SMB_open */
282     { NULL, { PMDA_PMID(4,74), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
283                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
284 /* SMB.SMB_open_time */
285     { NULL, { PMDA_PMID(4,75), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
286                 { 0,1,0,0,PM_TIME_USEC,0} }, },
287 /* SMB.SMB_create */
288     { NULL, { PMDA_PMID(4,76), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
289                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
290 /* SMB.SMB_create_time */
291     { NULL, { PMDA_PMID(4,77), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
292                 { 0,1,0,0,PM_TIME_USEC,0} }, },
293 /* SMB.SMB_close */
294     { NULL, { PMDA_PMID(4,78), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
295                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
296 /* SMB.SMB_close_time */
297     { NULL, { PMDA_PMID(4,79), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
298                 { 0,1,0,0,PM_TIME_USEC,0} }, },
299 /* SMB.SMB_flush */
300     { NULL, { PMDA_PMID(4,80), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
301                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
302 /* SMB.SMB_flush_time */
303     { NULL, { PMDA_PMID(4,81), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
304                 { 0,1,0,0,PM_TIME_USEC,0} }, },
305 /* SMB.SMB_unlink */
306     { NULL, { PMDA_PMID(4,82), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
307                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
308 /* SMB.SMB_unlink_time */
309     { NULL, { PMDA_PMID(4,83), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
310                 { 0,1,0,0,PM_TIME_USEC,0} }, },
311 /* SMB.SMB_mv */
312     { NULL, { PMDA_PMID(4,84), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
313                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
314 /* SMB.SMB_mv_time */
315     { NULL, { PMDA_PMID(4,85), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
316                 { 0,1,0,0,PM_TIME_USEC,0} }, },
317 /* SMB.SMB_getattr */
318     { NULL, { PMDA_PMID(4,86), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
319                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
320 /* SMB.SMB_getattr_time */
321     { NULL, { PMDA_PMID(4,87), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
322                 { 0,1,0,0,PM_TIME_USEC,0} }, },
323 /* SMB.SMB_setattr */
324     { NULL, { PMDA_PMID(4,88), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
325                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
326 /* SMB.SMB_setattr_time */
327     { NULL, { PMDA_PMID(4,89), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
328                 { 0,1,0,0,PM_TIME_USEC,0} }, },
329 /* SMB.SMB_read */
330     { NULL, { PMDA_PMID(4,90), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
331                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
332 /* SMB.SMB_read_time */
333     { NULL, { PMDA_PMID(4,91), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
334                 { 0,1,0,0,PM_TIME_USEC,0} }, },
335 /* SMB.SMB_write */
336     { NULL, { PMDA_PMID(4,92), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
337                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
338 /* SMB.SMB_write_time */
339     { NULL, { PMDA_PMID(4,93), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
340                 { 0,1,0,0,PM_TIME_USEC,0} }, },
341 /* SMB.SMB_lock */
342     { NULL, { PMDA_PMID(4,94), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
343                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
344 /* SMB.SMB_lock_time */
345     { NULL, { PMDA_PMID(4,95), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
346                 { 0,1,0,0,PM_TIME_USEC,0} }, },
347 /* SMB.SMB_unlock */
348     { NULL, { PMDA_PMID(4,96), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
349                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
350 /* SMB.SMB_unlock_time */
351     { NULL, { PMDA_PMID(4,97), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
352                 { 0,1,0,0,PM_TIME_USEC,0} }, },
353 /* SMB.SMB_ctemp */
354     { NULL, { PMDA_PMID(4,98), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
355                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
356 /* SMB.SMB_ctemp_time */
357     { NULL, { PMDA_PMID(4,99), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
358                 { 0,1,0,0,PM_TIME_USEC,0} }, },
359 /* SMB.SMB_mknew */
360     { NULL, { PMDA_PMID(4,100), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
361                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
362 /* SMB.SMB_mknew_time */
363     { NULL, { PMDA_PMID(4,101), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
364                 { 0,1,0,0,PM_TIME_USEC,0} }, },
365 /* SMB.SMB_chkpth */
366     { NULL, { PMDA_PMID(4,102), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
367                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
368 /* SMB.SMB_chkpth_time */
369     { NULL, { PMDA_PMID(4,103), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
370                 { 0,1,0,0,PM_TIME_USEC,0} }, },
371 /* SMB.SMB_exit */
372     { NULL, { PMDA_PMID(4,104), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
373                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
374 /* SMB.SMB_exit_time */
375     { NULL, { PMDA_PMID(4,105), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
376                 { 0,1,0,0,PM_TIME_USEC,0} }, },
377 /* SMB.SMB_lseek */
378     { NULL, { PMDA_PMID(4,106), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
379                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
380 /* SMB.SMB_lseek_time */
381     { NULL, { PMDA_PMID(4,107), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
382                 { 0,1,0,0,PM_TIME_USEC,0} }, },
383 /* SMB.SMB_lockread */
384     { NULL, { PMDA_PMID(4,108), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
385                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
386 /* SMB.SMB_lockread_time */
387     { NULL, { PMDA_PMID(4,109), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
388                 { 0,1,0,0,PM_TIME_USEC,0} }, },
389 /* SMB.SMB_writeunlock */
390     { NULL, { PMDA_PMID(4,110), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
391                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
392 /* SMB.SMB_writeunlock_time */
393     { NULL, { PMDA_PMID(4,111), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
394                 { 0,1,0,0,PM_TIME_USEC,0} }, },
395 /* SMB.SMB_readBraw */
396     { NULL, { PMDA_PMID(4,112), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
397                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
398 /* SMB.SMB_readBraw_time */
399     { NULL, { PMDA_PMID(4,113), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
400                 { 0,1,0,0,PM_TIME_USEC,0} }, },
401 /* SMB.SMB_readBmpx */
402     { NULL, { PMDA_PMID(4,114), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
403                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
404 /* SMB.SMB_readBmpx_time */
405     { NULL, { PMDA_PMID(4,115), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
406                 { 0,1,0,0,PM_TIME_USEC,0} }, },
407 /* SMB.SMB_readBs */
408     { NULL, { PMDA_PMID(4,116), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
409                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
410 /* SMB.SMB_readBs_time */
411     { NULL, { PMDA_PMID(4,117), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
412                 { 0,1,0,0,PM_TIME_USEC,0} }, },
413 /* SMB.SMB_writeBraw */
414     { NULL, { PMDA_PMID(4,118), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
415                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
416 /* SMB.SMB_writeBraw_time */
417     { NULL, { PMDA_PMID(4,119), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
418                 { 0,1,0,0,PM_TIME_USEC,0} }, },
419 /* SMB.SMB_writeBmpx */
420     { NULL, { PMDA_PMID(4,120), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
421                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
422 /* SMB.SMB_writeBmpx_time */
423     { NULL, { PMDA_PMID(4,121), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
424                 { 0,1,0,0,PM_TIME_USEC,0} }, },
425 /* SMB.SMB_writeBs */
426     { NULL, { PMDA_PMID(4,122), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
427                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
428 /* SMB.SMB_writeBs_time */
429     { NULL, { PMDA_PMID(4,123), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
430                 { 0,1,0,0,PM_TIME_USEC,0} }, },
431 /* SMB.SMB_writec */
432     { NULL, { PMDA_PMID(4,124), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
433                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
434 /* SMB.SMB_writec_time */
435     { NULL, { PMDA_PMID(4,125), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
436                 { 0,1,0,0,PM_TIME_USEC,0} }, },
437 /* SMB.SMB_setattrE */
438     { NULL, { PMDA_PMID(4,126), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
439                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
440 /* SMB.SMB_setattrE_time */
441     { NULL, { PMDA_PMID(4,127), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
442                 { 0,1,0,0,PM_TIME_USEC,0} }, },
443 /* SMB.SMB_getattrE */
444     { NULL, { PMDA_PMID(4,128), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
445                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
446 /* SMB.SMB_getattrE_time */
447     { NULL, { PMDA_PMID(4,129), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
448                 { 0,1,0,0,PM_TIME_USEC,0} }, },
449 /* SMB.SMB_lockingX */
450     { NULL, { PMDA_PMID(4,130), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
451                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
452 /* SMB.SMB_lockingX_time */
453     { NULL, { PMDA_PMID(4,131), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
454                 { 0,1,0,0,PM_TIME_USEC,0} }, },
455 /* SMB.SMB_trans */
456     { NULL, { PMDA_PMID(4,132), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
457                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
458 /* SMB.SMB_trans_time */
459     { NULL, { PMDA_PMID(4,133), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
460                 { 0,1,0,0,PM_TIME_USEC,0} }, },
461 /* SMB.SMB_transs */
462     { NULL, { PMDA_PMID(4,134), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
463                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
464 /* SMB.SMB_transs_time */
465     { NULL, { PMDA_PMID(4,135), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
466                 { 0,1,0,0,PM_TIME_USEC,0} }, },
467 /* SMB.SMB_ioctl */
468     { NULL, { PMDA_PMID(4,136), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
469                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
470 /* SMB.SMB_ioctl_time */
471     { NULL, { PMDA_PMID(4,137), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
472                 { 0,1,0,0,PM_TIME_USEC,0} }, },
473 /* SMB.SMB_ioctls */
474     { NULL, { PMDA_PMID(4,138), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
475                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
476 /* SMB.SMB_ioctls_time */
477     { NULL, { PMDA_PMID(4,139), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
478                 { 0,1,0,0,PM_TIME_USEC,0} }, },
479 /* SMB.SMB_copy */
480     { NULL, { PMDA_PMID(4,140), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
481                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
482 /* SMB.SMB_copy_time */
483     { NULL, { PMDA_PMID(4,141), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
484                 { 0,1,0,0,PM_TIME_USEC,0} }, },
485 /* SMB.SMB_move */
486     { NULL, { PMDA_PMID(4,142), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
487                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
488 /* SMB.SMB_move_time */
489     { NULL, { PMDA_PMID(4,143), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
490                 { 0,1,0,0,PM_TIME_USEC,0} }, },
491 /* SMB.SMB_echo */
492     { NULL, { PMDA_PMID(4,144), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
493                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
494 /* SMB.SMB_echo_time */
495     { NULL, { PMDA_PMID(4,145), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
496                 { 0,1,0,0,PM_TIME_USEC,0} }, },
497 /* SMB.SMB_writeclose */
498     { NULL, { PMDA_PMID(4,146), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
499                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
500 /* SMB.SMB_writeclose_time */
501     { NULL, { PMDA_PMID(4,147), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
502                 { 0,1,0,0,PM_TIME_USEC,0} }, },
503 /* SMB.SMB_openX */
504     { NULL, { PMDA_PMID(4,148), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
505                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
506 /* SMB.SMB_openX_time */
507     { NULL, { PMDA_PMID(4,149), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
508                 { 0,1,0,0,PM_TIME_USEC,0} }, },
509 /* SMB.SMB_readX */
510     { NULL, { PMDA_PMID(4,150), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
511                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
512 /* SMB.SMB_readX_time */
513     { NULL, { PMDA_PMID(4,151), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
514                 { 0,1,0,0,PM_TIME_USEC,0} }, },
515 /* SMB.SMB_writeX */
516     { NULL, { PMDA_PMID(4,152), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
517                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
518 /* SMB.SMB_writeX_time */
519     { NULL, { PMDA_PMID(4,153), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
520                 { 0,1,0,0,PM_TIME_USEC,0} }, },
521 /* SMB.SMB_trans2 */
522     { NULL, { PMDA_PMID(4,154), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
523                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
524 /* SMB.SMB_trans2_time */
525     { NULL, { PMDA_PMID(4,155), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
526                 { 0,1,0,0,PM_TIME_USEC,0} }, },
527 /* SMB.SMB_transs2 */
528     { NULL, { PMDA_PMID(4,156), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
529                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
530 /* SMB.SMB_transs2_time */
531     { NULL, { PMDA_PMID(4,157), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
532                 { 0,1,0,0,PM_TIME_USEC,0} }, },
533 /* SMB.SMB_findclose */
534     { NULL, { PMDA_PMID(4,158), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
535                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
536 /* SMB.SMB_findclose_time */
537     { NULL, { PMDA_PMID(4,159), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
538                 { 0,1,0,0,PM_TIME_USEC,0} }, },
539 /* SMB.SMB_findNclose */
540     { NULL, { PMDA_PMID(4,160), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
541                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
542 /* SMB.SMB_findNclose_time */
543     { NULL, { PMDA_PMID(4,161), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
544                 { 0,1,0,0,PM_TIME_USEC,0} }, },
545 /* SMB.SMB_tcon */
546     { NULL, { PMDA_PMID(4,162), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
547                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
548 /* SMB.SMB_tcon_time */
549     { NULL, { PMDA_PMID(4,163), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
550                 { 0,1,0,0,PM_TIME_USEC,0} }, },
551 /* SMB.SMB_tdis */
552     { NULL, { PMDA_PMID(4,164), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
553                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
554 /* SMB.SMB_tdis_time */
555     { NULL, { PMDA_PMID(4,165), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
556                 { 0,1,0,0,PM_TIME_USEC,0} }, },
557 /* SMB.SMB_negprot */
558     { NULL, { PMDA_PMID(4,166), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
559                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
560 /* SMB.SMB_negprot_time */
561     { NULL, { PMDA_PMID(4,167), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
562                 { 0,1,0,0,PM_TIME_USEC,0} }, },
563 /* SMB.SMB_sessetupX */
564     { NULL, { PMDA_PMID(4,168), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
565                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
566 /* SMB.SMB_sessetupX_time */
567     { NULL, { PMDA_PMID(4,169), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
568                 { 0,1,0,0,PM_TIME_USEC,0} }, },
569 /* SMB.SMB_ulogoffX */
570     { NULL, { PMDA_PMID(4,170), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
571                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
572 /* SMB.SMB_ulogoffX_time */
573     { NULL, { PMDA_PMID(4,171), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
574                 { 0,1,0,0,PM_TIME_USEC,0} }, },
575 /* SMB.SMB_tconX */
576     { NULL, { PMDA_PMID(4,172), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
577                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
578 /* SMB.SMB_tconX_time */
579     { NULL, { PMDA_PMID(4,173), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
580                 { 0,1,0,0,PM_TIME_USEC,0} }, },
581 /* SMB.SMB_dskattr */
582     { NULL, { PMDA_PMID(4,174), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
583                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
584 /* SMB.SMB_dskattr_time */
585     { NULL, { PMDA_PMID(4,175), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
586                 { 0,1,0,0,PM_TIME_USEC,0} }, },
587 /* SMB.SMB_search */
588     { NULL, { PMDA_PMID(4,176), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
589                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
590 /* SMB.SMB_search_time */
591     { NULL, { PMDA_PMID(4,177), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
592                 { 0,1,0,0,PM_TIME_USEC,0} }, },
593 /* SMB.SMB_ffisrst */
594     { NULL, { PMDA_PMID(4,178), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
595                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
596 /* SMB.SMB_ffisrst_time */
597     { NULL, { PMDA_PMID(4,179), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
598                 { 0,1,0,0,PM_TIME_USEC,0} }, },
599 /* SMB.SMB_funique */
600     { NULL, { PMDA_PMID(4,180), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
601                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
602 /* SMB.SMB_funique_time */
603     { NULL, { PMDA_PMID(4,181), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
604                 { 0,1,0,0,PM_TIME_USEC,0} }, },
605 /* SMB.SMB_fclose */
606     { NULL, { PMDA_PMID(4,182), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
607                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
608 /* SMB.SMB_fclose_time */
609     { NULL, { PMDA_PMID(4,183), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
610                 { 0,1,0,0,PM_TIME_USEC,0} }, },
611 /* SMB.SMB_NTtrans */
612     { NULL, { PMDA_PMID(4,184), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
613                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
614 /* SMB.SMB_NTtrans_time */
615     { NULL, { PMDA_PMID(4,185), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
616                 { 0,1,0,0,PM_TIME_USEC,0} }, },
617 /* SMB.SMB_NTtranss */
618     { NULL, { PMDA_PMID(4,186), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
619                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
620 /* SMB.SMB_NTtranss_time */
621     { NULL, { PMDA_PMID(4,187), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
622                 { 0,1,0,0,PM_TIME_USEC,0} }, },
623 /* SMB.SMB_NTcreateX */
624     { NULL, { PMDA_PMID(4,188), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
625                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
626 /* SMB.SMB_NTcreateX_time */
627     { NULL, { PMDA_PMID(4,189), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
628                 { 0,1,0,0,PM_TIME_USEC,0} }, },
629 /* SMB.SMB_NTcancel */
630     { NULL, { PMDA_PMID(4,190), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
631                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
632 /* SMB.SMB_NTcancel_time */
633     { NULL, { PMDA_PMID(4,191), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
634                 { 0,1,0,0,PM_TIME_USEC,0} }, },
635 /* SMB.SMB_splopen */
636     { NULL, { PMDA_PMID(4,192), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
637                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
638 /* SMB.SMB_splopen_time */
639     { NULL, { PMDA_PMID(4,193), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
640                 { 0,1,0,0,PM_TIME_USEC,0} }, },
641 /* SMB.SMB_splwrite */
642     { NULL, { PMDA_PMID(4,194), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
643                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
644 /* SMB.SMB_splwrite_time */
645     { NULL, { PMDA_PMID(4,195), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
646                 { 0,1,0,0,PM_TIME_USEC,0} }, },
647 /* SMB.SMB_splclose */
648     { NULL, { PMDA_PMID(4,196), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
649                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
650 /* SMB.SMB_splclose_time */
651     { NULL, { PMDA_PMID(4,197), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
652                 { 0,1,0,0,PM_TIME_USEC,0} }, },
653 /* SMB.SMB_splretq */
654     { NULL, { PMDA_PMID(4,198), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
655                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
656 /* SMB.SMB_splretq_time */
657     { NULL, { PMDA_PMID(4,199), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
658                 { 0,1,0,0,PM_TIME_USEC,0} }, },
659 /* SMB.SMB_sends */
660     { NULL, { PMDA_PMID(4,200), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
661                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
662 /* SMB.SMB_sends_time */
663     { NULL, { PMDA_PMID(4,201), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
664                 { 0,1,0,0,PM_TIME_USEC,0} }, },
665 /* SMB.SMB_sendb */
666     { NULL, { PMDA_PMID(4,202), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
667                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
668 /* SMB.SMB_sendb_time */
669     { NULL, { PMDA_PMID(4,203), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
670                 { 0,1,0,0,PM_TIME_USEC,0} }, },
671 /* SMB.SMB_fwdname */
672     { NULL, { PMDA_PMID(4,204), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
673                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
674 /* SMB.SMB_fwdname_time */
675     { NULL, { PMDA_PMID(4,205), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
676                 { 0,1,0,0,PM_TIME_USEC,0} }, },
677 /* SMB.SMB_cancelf */
678     { NULL, { PMDA_PMID(4,206), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
679                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
680 /* SMB.SMB_cancelf_time */
681     { NULL, { PMDA_PMID(4,207), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
682                 { 0,1,0,0,PM_TIME_USEC,0} }, },
683 /* SMB.SMB_getmach */
684     { NULL, { PMDA_PMID(4,208), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
685                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
686 /* SMB.SMB_getmach_time */
687     { NULL, { PMDA_PMID(4,209), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
688                 { 0,1,0,0,PM_TIME_USEC,0} }, },
689 /* SMB.SMB_sendstrt */
690     { NULL, { PMDA_PMID(4,210), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
691                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
692 /* SMB.SMB_sendstrt_time */
693     { NULL, { PMDA_PMID(4,211), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
694                 { 0,1,0,0,PM_TIME_USEC,0} }, },
695 /* SMB.SMB_sendend */
696     { NULL, { PMDA_PMID(4,212), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
697                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
698 /* SMB.SMB_sendend_time */
699     { NULL, { PMDA_PMID(4,213), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
700                 { 0,1,0,0,PM_TIME_USEC,0} }, },
701 /* SMB.SMB_sendtxt */
702     { NULL, { PMDA_PMID(4,214), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
703                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
704 /* SMB.SMB_sendtxt_time */
705     { NULL, { PMDA_PMID(4,215), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
706                 { 0,1,0,0,PM_TIME_USEC,0} }, },
707 /* SMB.SMB_invalid */
708     { NULL, { PMDA_PMID(4,216), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
709                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
710 /* SMB.SMB_invalid_time */
711     { NULL, { PMDA_PMID(4,217), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
712                 { 0,1,0,0,PM_TIME_USEC,0} }, },
713 /* SMB.PATHWORK_setdir */
714     { NULL, { PMDA_PMID(4,218), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
715                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
716 /* SMB.PATHWORK_setdir_time */
717     { NULL, { PMDA_PMID(4,219), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
718                 { 0,1,0,0,PM_TIME_USEC,0} }, },
719 /* SMB.TRANS2_open */
720     { NULL, { PMDA_PMID(4,220), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
721                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
722 /* SMB.TRANS2_open_time */
723     { NULL, { PMDA_PMID(4,221), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
724                 { 0,1,0,0,PM_TIME_USEC,0} }, },
725 /* SMB.TRANS2_ffirst */
726     { NULL, { PMDA_PMID(4,222), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
727                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
728 /* SMB.TRANS2_ffirst_time */
729     { NULL, { PMDA_PMID(4,223), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
730                 { 0,1,0,0,PM_TIME_USEC,0} }, },
731 /* SMB.TRANS2_fnext */
732     { NULL, { PMDA_PMID(4,224), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
733                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
734 /* SMB.TRANS2_fnext_time */
735     { NULL, { PMDA_PMID(4,225), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
736                 { 0,1,0,0,PM_TIME_USEC,0} }, },
737 /* SMB.TRANS2_qfsinfo */
738     { NULL, { PMDA_PMID(4,226), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
739                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
740 /* SMB.TRANS2_qfsinfo_time */
741     { NULL, { PMDA_PMID(4,227), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
742                 { 0,1,0,0,PM_TIME_USEC,0} }, },
743 /* SMB.TRANS2_sfsinfo */
744     { NULL, { PMDA_PMID(4,228), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
745                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
746 /* SMB.TRANS2_sfsinfo_time */
747     { NULL, { PMDA_PMID(4,229), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
748                 { 0,1,0,0,PM_TIME_USEC,0} }, },
749 /* SMB.TRANS2_qpathinfo */
750     { NULL, { PMDA_PMID(4,230), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
751                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
752 /* SMB.TRANS2_qpathinfo_time */
753     { NULL, { PMDA_PMID(4,231), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
754                 { 0,1,0,0,PM_TIME_USEC,0} }, },
755 /* SMB.TRANS2_spathinfo */
756     { NULL, { PMDA_PMID(4,232), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
757                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
758 /* SMB.TRANS2_spathinfo_time */
759     { NULL, { PMDA_PMID(4,233), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
760                 { 0,1,0,0,PM_TIME_USEC,0} }, },
761 /* SMB.TRANS2_qfileinfo */
762     { NULL, { PMDA_PMID(4,234), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
763                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
764 /* SMB.TRANS2_qfileinfo_time */
765     { NULL, { PMDA_PMID(4,235), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
766                 { 0,1,0,0,PM_TIME_USEC,0} }, },
767 /* SMB.TRANS2_sfileinfo */
768     { NULL, { PMDA_PMID(4,236), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
769                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
770 /* SMB.TRANS2_sfileinfo_time */
771     { NULL, { PMDA_PMID(4,237), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
772                 { 0,1,0,0,PM_TIME_USEC,0} }, },
773 /* SMB.TRANS2_fsctl */
774     { NULL, { PMDA_PMID(4,238), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
775                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
776 /* SMB.TRANS2_fsctl_time */
777     { NULL, { PMDA_PMID(4,239), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
778                 { 0,1,0,0,PM_TIME_USEC,0} }, },
779 /* SMB.TRANS2_ioctl */
780     { NULL, { PMDA_PMID(4,240), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
781                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
782 /* SMB.TRANS2_ioctl_time */
783     { NULL, { PMDA_PMID(4,241), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
784                 { 0,1,0,0,PM_TIME_USEC,0} }, },
785 /* SMB.TRANS2_fnotifyfirst */
786     { NULL, { PMDA_PMID(4,242), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
787                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
788 /* SMB.TRANS2_fnotifyfirst_time */
789     { NULL, { PMDA_PMID(4,243), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
790                 { 0,1,0,0,PM_TIME_USEC,0} }, },
791 /* SMB.TRANS2_fnotifynext */
792     { NULL, { PMDA_PMID(4,244), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
793                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
794 /* SMB.TRANS2_fnotifynext_time */
795     { NULL, { PMDA_PMID(4,245), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
796                 { 0,1,0,0,PM_TIME_USEC,0} }, },
797 /* SMB.TRANS2_mkdir */
798     { NULL, { PMDA_PMID(4,246), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
799                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
800 /* SMB.TRANS2_mkdir_time */
801     { NULL, { PMDA_PMID(4,247), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
802                 { 0,1,0,0,PM_TIME_USEC,0} }, },
803 /* SMB.TRANS2_sessetup */
804     { NULL, { PMDA_PMID(4,248), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
805                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
806 /* SMB.TRANS2_sessetup_time */
807     { NULL, { PMDA_PMID(4,249), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
808                 { 0,1,0,0,PM_TIME_USEC,0} }, },
809 /* SMB.TRANS2_getDFSref */
810     { NULL, { PMDA_PMID(4,250), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
811                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
812 /* SMB.TRANS2_getDFSref_time */
813     { NULL, { PMDA_PMID(4,251), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
814                 { 0,1,0,0,PM_TIME_USEC,0} }, },
815 /* SMB.TRANS2_rptDFSinconsist */
816     { NULL, { PMDA_PMID(4,252), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
817                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
818 /* SMB.TRANS2_rptDFSinconsist_time */
819     { NULL, { PMDA_PMID(4,253), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
820                 { 0,1,0,0,PM_TIME_USEC,0} }, },
821 /* SMB.NTTRANS_create */
822     { NULL, { PMDA_PMID(4,254), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
823                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
824 /* SMB.NTTRANS_create_time */
825     { NULL, { PMDA_PMID(4,255), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
826                 { 0,1,0,0,PM_TIME_USEC,0} }, },
827 /* SMB.NTTRANS_ioctl */
828     { NULL, { PMDA_PMID(4,256), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
829                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
830 /* SMB.NTTRANS_ioctl_time */
831     { NULL, { PMDA_PMID(4,257), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
832                 { 0,1,0,0,PM_TIME_USEC,0} }, },
833 /* SMB.NTTRANS_setsecdesc */
834     { NULL, { PMDA_PMID(4,258), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
835                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
836 /* SMB.NTTRANS_setsecdesc_time */
837     { NULL, { PMDA_PMID(4,259), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
838                 { 0,1,0,0,PM_TIME_USEC,0} }, },
839 /* SMB.NTTRANS_notifychange */
840     { NULL, { PMDA_PMID(4,260), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
841                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
842 /* SMB.NTTRANS_notifychange_time */
843     { NULL, { PMDA_PMID(4,261), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
844                 { 0,1,0,0,PM_TIME_USEC,0} }, },
845 /* SMB.NTTRANS_rename */
846     { NULL, { PMDA_PMID(4,262), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
847                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
848 /* SMB.NTTRANS_rename_time */
849     { NULL, { PMDA_PMID(4,263), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
850                 { 0,1,0,0,PM_TIME_USEC,0} }, },
851 /* SMB.NTTRANS_qsecdesc */
852     { NULL, { PMDA_PMID(4,264), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
853                 { 0,0,1,0,0,PM_COUNT_ONE} }, },
854 /* SMB.NTTRANS_qsecdesc_time */
855     { NULL, { PMDA_PMID(4,265), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER, 
856                 { 0,1,0,0,PM_TIME_USEC,0} }, }
857 };
858
859 extern int      errno;
860 struct profile_stats    *stats;
861 struct profile_header   *shmheader;
862 int             shmid = -1;
863
864
865 int
866 samba_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
867 {
868     __pmID_int          *idp = (__pmID_int *)&(mdesc->m_desc.pmid);
869
870     if (inst != PM_IN_NULL && mdesc->m_desc.indom == PM_INDOM_NULL)
871         return PM_ERR_INST;
872
873     if (idp->cluster == 0) {
874         switch (idp->item) {
875             case 0:                     /* smbd.smb_count */
876                 atom->ul = stats->smb_count;
877                 break;
878             case 1:                     /* smb.uid_changes */
879                 atom->ul = stats->uid_changes;
880                 break;
881             default:
882                 return PM_ERR_PMID;
883         }
884     }
885     else if (idp->cluster == 1) {
886         switch (idp->item) {
887             case 2:                     /* syscalls.opendir */
888                 atom->ul = stats->syscall_opendir_count;
889                 break;
890             case 3:                     /* syscalls.opendir */
891                 atom->ul = stats->syscall_opendir_time;
892                 break;
893             case 4:                     /* syscalls.readdir */
894                 atom->ul = stats->syscall_readdir_count;
895                 break;
896             case 5:                     /* syscalls.readdir */
897                 atom->ul = stats->syscall_readdir_time;
898                 break;
899             case 6:                     /* syscalls.mkdir */
900                 atom->ul = stats->syscall_mkdir_count;
901                 break;
902             case 7:                     /* syscalls.mkdir */
903                 atom->ul = stats->syscall_mkdir_time;
904                 break;
905             case 8:                     /* syscalls.rmdir */
906                 atom->ul = stats->syscall_rmdir_count;
907                 break;
908             case 9:                     /* syscalls.rmdir */
909                 atom->ul = stats->syscall_rmdir_time;
910                 break;
911             case 10:                    /* syscalls.closedir */
912                 atom->ul = stats->syscall_closedir_count;
913                 break;
914             case 11:                    /* syscalls.closedir */
915                 atom->ul = stats->syscall_closedir_time;
916                 break;
917             case 12:                    /* syscalls.open */
918                 atom->ul = stats->syscall_open_count;
919                 break;
920             case 13:                    /* syscalls.open */
921                 atom->ul = stats->syscall_open_time;
922                 break;
923             case 14:                    /* syscalls.close */
924                 atom->ul = stats->syscall_close_count;
925                 break;
926             case 15:                    /* syscalls.close */
927                 atom->ul = stats->syscall_close_time;
928                 break;
929             case 16:                    /* syscalls.read */
930                 atom->ul = stats->syscall_read_count;
931                 break;
932             case 17:                    /* syscalls.read */
933                 atom->ul = stats->syscall_read_time;
934                 break;
935             case 18:                    /* syscalls.read */
936                 atom->ul = stats->syscall_read_bytes;
937                 break;
938             case 19:                    /* syscalls.write */
939                 atom->ul = stats->syscall_write_count;
940                 break;
941             case 20:                    /* syscalls.write */
942                 atom->ul = stats->syscall_write_time;
943                 break;
944             case 21:                    /* syscalls.write */
945                 atom->ul = stats->syscall_write_bytes;
946                 break;
947             case 22:                    /* syscalls.lseek */
948                 atom->ul = stats->syscall_lseek_count;
949                 break;
950             case 23:                    /* syscalls.lseek */
951                 atom->ul = stats->syscall_lseek_time;
952                 break;
953             case 24:                    /* syscalls.rename */
954                 atom->ul = stats->syscall_rename_count;
955                 break;
956             case 25:                    /* syscalls.rename */
957                 atom->ul = stats->syscall_rename_time;
958                 break;
959             case 26:                    /* syscalls.fsync */
960                 atom->ul = stats->syscall_fsync_count;
961                 break;
962             case 27:                    /* syscalls.fsync */
963                 atom->ul = stats->syscall_fsync_time;
964                 break;
965             case 28:                    /* syscalls.stat */
966                 atom->ul = stats->syscall_stat_count;
967                 break;
968             case 29:                    /* syscalls.stat */
969                 atom->ul = stats->syscall_stat_time;
970                 break;
971             case 30:                    /* syscalls.fstat */
972                 atom->ul = stats->syscall_fstat_count;
973                 break;
974             case 31:                    /* syscalls.fstat */
975                 atom->ul = stats->syscall_fstat_time;
976                 break;
977             case 32:                    /* syscalls.lstat */
978                 atom->ul = stats->syscall_lstat_count;
979                 break;
980             case 33:                    /* syscalls.lstat */
981                 atom->ul = stats->syscall_lstat_time;
982                 break;
983             case 34:                    /* syscalls.unlink */
984                 atom->ul = stats->syscall_unlink_count;
985                 break;
986             case 35:                    /* syscalls.unlink */
987                 atom->ul = stats->syscall_unlink_time;
988                 break;
989             case 36:                    /* syscalls.chmod */
990                 atom->ul = stats->syscall_chmod_count;
991                 break;
992             case 37:                    /* syscalls.chmod */
993                 atom->ul = stats->syscall_chmod_time;
994                 break;
995             case 38:                    /* syscalls.chown */
996                 atom->ul = stats->syscall_chown_count;
997                 break;
998             case 39:                    /* syscalls.chown */
999                 atom->ul = stats->syscall_chown_time;
1000                 break;
1001             case 40:                    /* syscalls.chdir */
1002                 atom->ul = stats->syscall_chdir_count;
1003                 break;
1004             case 41:                    /* syscalls.chdir */
1005                 atom->ul = stats->syscall_chdir_time;
1006                 break;
1007             case 42:                    /* syscalls.getwd */
1008                 atom->ul = stats->syscall_getwd_count;
1009                 break;
1010             case 43:                    /* syscalls.getwd */
1011                 atom->ul = stats->syscall_getwd_time;
1012                 break;
1013             case 44:                    /* syscalls.utime */
1014                 atom->ul = stats->syscall_utime_count;
1015                 break;
1016             case 45:                    /* syscalls.utime */
1017                 atom->ul = stats->syscall_utime_time;
1018                 break;
1019             case 46:                    /* syscalls.ftruncate */
1020                 atom->ul = stats->syscall_ftruncate_count;
1021                 break;
1022             case 47:                    /* syscalls.ftruncate */
1023                 atom->ul = stats->syscall_ftruncate_time;
1024                 break;
1025             case 48:                    /* syscalls.fcntl_lock */
1026                 atom->ul = stats->syscall_fcntl_lock_count;
1027                 break;
1028             case 49:                    /* syscalls.fcntl_lock */
1029                 atom->ul = stats->syscall_fcntl_lock_time;
1030                 break;
1031             default:
1032                 return PM_ERR_PMID;
1033         }
1034     }
1035     else if (idp->cluster == 2) {
1036         switch (idp->item) {
1037             case 50:                    /* statcache.lookups */
1038                 atom->ul = stats->statcache_lookups;
1039                 break;
1040             case 51:                    /* statcache.misses */
1041                 atom->ul = stats->statcache_misses;
1042                 break;
1043             case 52:                    /* statcache.hits */
1044                 atom->ul = stats->statcache_hits;
1045                 break;
1046             default:
1047                 return PM_ERR_PMID;
1048         }
1049     }
1050     else if (idp->cluster == 3) {
1051         switch (idp->item) {
1052             case 53:                    /* writecache.num_caches */
1053                 atom->ul = stats->writecache_num_write_caches;
1054                 break;
1055             case 54:                    /* writecache.allocated_caches */
1056                 atom->ul = stats->writecache_allocated_write_caches;
1057                 break;
1058             case 55:                    /* writecache.read_hits */
1059                 atom->ul = stats->writecache_read_hits;
1060                 break;
1061             case 56:                    /* writecache.total_writes */
1062                 atom->ul = stats->writecache_total_writes;
1063                 break;
1064             case 57:                    /* writecache.init_writes */
1065                 atom->ul = stats->writecache_init_writes;
1066                 break;
1067             case 58:                    /* writecache.abutted_writes */
1068                 atom->ul = stats->writecache_abutted_writes;
1069                 break;
1070             case 59:                    /* writecache.perfect_writes */
1071                 atom->ul = stats->writecache_num_perfect_writes;
1072                 break;
1073             case 60:                    /* writecache.direct_writes */
1074                 atom->ul = stats->writecache_direct_writes;
1075                 break;
1076             case 61:                    /* writecache.non_oplock_writes */
1077                 atom->ul = stats->writecache_non_oplock_writes;
1078                 break;
1079             case 62:                    /* writecache.seek_flush */
1080                 atom->ul = stats->writecache_flushed_writes[SEEK_FLUSH];
1081                 break;
1082             case 63:                    /* writecache.read_flush */
1083                 atom->ul = stats->writecache_flushed_writes[READ_FLUSH];
1084                 break;
1085             case 64:                    /* writecache.write_flush */
1086                 atom->ul = stats->writecache_flushed_writes[WRITE_FLUSH];
1087                 break;
1088             case 65:                    /* writecache.readraw_flush */
1089                 atom->ul = stats->writecache_flushed_writes[READRAW_FLUSH];
1090                 break;
1091             case 66:                    /* writecache.oplock_rel_flush */
1092                 atom->ul = stats->writecache_flushed_writes[OPLOCK_RELEASE_FLUSH];
1093                 break;
1094             case 67:                    /* writecache.close_flush */
1095                 atom->ul = stats->writecache_flushed_writes[CLOSE_FLUSH];
1096                 break;
1097             case 68:                    /* writecache.sync_flush */
1098                 atom->ul = stats->writecache_flushed_writes[SYNC_FLUSH];
1099                 break;
1100             case 69:                    /* writecache.size_change_flush */
1101                 atom->ul = stats->writecache_flushed_writes[SIZECHANGE_FLUSH];
1102                 break;
1103             default:
1104                 return PM_ERR_PMID;
1105         }
1106     }
1107     else if (idp->cluster == 4) {
1108         switch (idp->item) {
1109             case 70:                    /* SMB.SMB_mkdir */
1110                 atom->ul = stats->SMBmkdir_count;
1111                 break;
1112             case 71:                    /* SMB.SMB_mkdir */
1113                 atom->ul = stats->SMBmkdir_time;
1114                 break;
1115             case 72:                    /* SMB.SMB_rmdir */
1116                 atom->ul = stats->SMBrmdir_count;
1117                 break;
1118             case 73:                    /* SMB.SMB_rmdir */
1119                 atom->ul = stats->SMBrmdir_time;
1120                 break;
1121             case 74:                    /* SMB.SMB_open */
1122                 atom->ul = stats->SMBopen_count;
1123                 break;
1124             case 75:                    /* SMB.SMB_open */
1125                 atom->ul = stats->SMBopen_time;
1126                 break;
1127             case 76:                    /* SMB.SMB_create */
1128                 atom->ul = stats->SMBcreate_count;
1129                 break;
1130             case 77:                    /* SMB.SMB_create */
1131                 atom->ul = stats->SMBcreate_time;
1132                 break;
1133             case 78:                    /* SMB.SMB_close */
1134                 atom->ul = stats->SMBclose_count;
1135                 break;
1136             case 79:                    /* SMB.SMB_close */
1137                 atom->ul = stats->SMBclose_time;
1138                 break;
1139             case 80:                    /* SMB.SMB_flush */
1140                 atom->ul = stats->SMBflush_count;
1141                 break;
1142             case 81:                    /* SMB.SMB_flush */
1143                 atom->ul = stats->SMBflush_time;
1144                 break;
1145             case 82:                    /* SMB.SMB_unlink */
1146                 atom->ul = stats->SMBunlink_count;
1147                 break;
1148             case 83:                    /* SMB.SMB_unlink */
1149                 atom->ul = stats->SMBunlink_time;
1150                 break;
1151             case 84:                    /* SMB.SMB_mv */
1152                 atom->ul = stats->SMBmv_count;
1153                 break;
1154             case 85:                    /* SMB.SMB_mv */
1155                 atom->ul = stats->SMBmv_time;
1156                 break;
1157             case 86:                    /* SMB.SMB_getatr */
1158                 atom->ul = stats->SMBgetatr_count;
1159                 break;
1160             case 87:                    /* SMB.SMB_getatr */
1161                 atom->ul = stats->SMBgetatr_time;
1162                 break;
1163             case 88:                    /* SMB.SMB_setatr */
1164                 atom->ul = stats->SMBsetatr_count;
1165                 break;
1166             case 89:                    /* SMB.SMB_setatr */
1167                 atom->ul = stats->SMBsetatr_time;
1168                 break;
1169             case 90:                    /* SMB.SMB_read */
1170                 atom->ul = stats->SMBread_count;
1171                 break;
1172             case 91:                    /* SMB.SMB_read */
1173                 atom->ul = stats->SMBread_time;
1174                 break;
1175             case 92:                    /* SMB.SMB_write */
1176                 atom->ul = stats->SMBwrite_count;
1177                 break;
1178             case 93:                    /* SMB.SMB_write */
1179                 atom->ul = stats->SMBwrite_time;
1180                 break;
1181             case 94:                    /* SMB.SMB_lock */
1182                 atom->ul = stats->SMBlock_count;
1183                 break;
1184             case 95:                    /* SMB.SMB_lock */
1185                 atom->ul = stats->SMBlock_time;
1186                 break;
1187             case 96:                    /* SMB.SMB_unlock */
1188                 atom->ul = stats->SMBunlock_count;
1189                 break;
1190             case 97:                    /* SMB.SMB_unlock */
1191                 atom->ul = stats->SMBunlock_time;
1192                 break;
1193             case 98:                    /* SMB.SMB_ctemp */
1194                 atom->ul = stats->SMBctemp_count;
1195                 break;
1196             case 99:                    /* SMB.SMB_ctemp */
1197                 atom->ul = stats->SMBctemp_time;
1198                 break;
1199             case 100:                   /* SMB.SMB_mknew */
1200                 atom->ul = stats->SMBmknew_count;
1201                 break;
1202             case 101:                   /* SMB.SMB_mknew */
1203                 atom->ul = stats->SMBmknew_time;
1204                 break;
1205             case 102:                   /* SMB.SMB_chkpth */
1206                 atom->ul = stats->SMBchkpth_count;
1207                 break;
1208             case 103:                   /* SMB.SMB_chkpth */
1209                 atom->ul = stats->SMBchkpth_time;
1210                 break;
1211             case 104:                   /* SMB.SMB_exit */
1212                 atom->ul = stats->SMBexit_count;
1213                 break;
1214             case 105:                   /* SMB.SMB_exit */
1215                 atom->ul = stats->SMBexit_time;
1216                 break;
1217             case 106:                   /* SMB.SMB_lseek */
1218                 atom->ul = stats->SMBlseek_count;
1219                 break;
1220             case 107:                   /* SMB.SMB_lseek */
1221                 atom->ul = stats->SMBlseek_time;
1222                 break;
1223             case 108:                   /* SMB.SMB_lockread */
1224                 atom->ul = stats->SMBlockread_count;
1225                 break;
1226             case 109:                   /* SMB.SMB_lockread */
1227                 atom->ul = stats->SMBlockread_time;
1228                 break;
1229             case 110:                   /* SMB.SMB_writeunlock */
1230                 atom->ul = stats->SMBwriteunlock_count;
1231                 break;
1232             case 111:                   /* SMB.SMB_writeunlock */
1233                 atom->ul = stats->SMBwriteunlock_time;
1234                 break;
1235             case 112:                   /* SMB.SMB_readbraw */
1236                 atom->ul = stats->SMBreadbraw_count;
1237                 break;
1238             case 113:                   /* SMB.SMB_readbraw */
1239                 atom->ul = stats->SMBreadbraw_time;
1240                 break;
1241             case 114:                   /* SMB.SMB_readBmpx */
1242                 atom->ul = stats->SMBreadBmpx_count;
1243                 break;
1244             case 115:                   /* SMB.SMB_readBmpx */
1245                 atom->ul = stats->SMBreadBmpx_time;
1246                 break;
1247             case 116:                   /* SMB.SMB_readBs */
1248                 atom->ul = stats->SMBreadBs_count;
1249                 break;
1250             case 117:                   /* SMB.SMB_readBs */
1251                 atom->ul = stats->SMBreadBs_time;
1252                 break;
1253             case 118:                   /* SMB.SMB_writebraw */
1254                 atom->ul = stats->SMBwritebraw_count;
1255                 break;
1256             case 119:                   /* SMB.SMB_writebraw */
1257                 atom->ul = stats->SMBwritebraw_time;
1258                 break;
1259             case 120:                   /* SMB.SMB_writeBmpx */
1260                 atom->ul = stats->SMBwriteBmpx_count;
1261                 break;
1262             case 121:                   /* SMB.SMB_writeBmpx */
1263                 atom->ul = stats->SMBwriteBmpx_time;
1264                 break;
1265             case 122:                   /* SMB.SMB_writeBs */
1266                 atom->ul = stats->SMBwriteBs_count;
1267                 break;
1268             case 123:                   /* SMB.SMB_writeBs */
1269                 atom->ul = stats->SMBwriteBs_time;
1270                 break;
1271             case 124:                   /* SMB.SMB_writec */
1272                 atom->ul = stats->SMBwritec_count;
1273                 break;
1274             case 125:                   /* SMB.SMB_writec */
1275                 atom->ul = stats->SMBwritec_time;
1276                 break;
1277             case 126:                   /* SMB.SMB_setattrE */
1278                 atom->ul = stats->SMBsetattrE_count;
1279                 break;
1280             case 127:                   /* SMB.SMB_setattrE */
1281                 atom->ul = stats->SMBsetattrE_time;
1282                 break;
1283             case 128:                   /* SMB.SMB_getattrE */
1284                 atom->ul = stats->SMBgetattrE_count;
1285                 break;
1286             case 129:                   /* SMB.SMB_getattrE */
1287                 atom->ul = stats->SMBgetattrE_time;
1288                 break;
1289             case 130:                   /* SMB.SMB_lockingX */
1290                 atom->ul = stats->SMBlockingX_count;
1291                 break;
1292             case 131:                   /* SMB.SMB_lockingX */
1293                 atom->ul = stats->SMBlockingX_time;
1294                 break;
1295             case 132:                   /* SMB.SMB_trans */
1296                 atom->ul = stats->SMBtrans_count;
1297                 break;
1298             case 133:                   /* SMB.SMB_trans */
1299                 atom->ul = stats->SMBtrans_time;
1300                 break;
1301             case 134:                   /* SMB.SMB_transs */
1302                 atom->ul = stats->SMBtranss_count;
1303                 break;
1304             case 135:                   /* SMB.SMB_transs */
1305                 atom->ul = stats->SMBtranss_time;
1306                 break;
1307             case 136:                   /* SMB.SMB_ioctl */
1308                 atom->ul = stats->SMBioctl_count;
1309                 break;
1310             case 137:                   /* SMB.SMB_ioctl */
1311                 atom->ul = stats->SMBioctl_time;
1312                 break;
1313             case 138:                   /* SMB.SMB_ioctls */
1314                 atom->ul = stats->SMBioctls_count;
1315                 break;
1316             case 139:                   /* SMB.SMB_ioctls */
1317                 atom->ul = stats->SMBioctls_time;
1318                 break;
1319             case 140:                   /* SMB.SMB_copy */
1320                 atom->ul = stats->SMBcopy_count;
1321                 break;
1322             case 141:                   /* SMB.SMB_copy */
1323                 atom->ul = stats->SMBcopy_time;
1324                 break;
1325             case 142:                   /* SMB.SMB_move */
1326                 atom->ul = stats->SMBmove_count;
1327                 break;
1328             case 143:                   /* SMB.SMB_move */
1329                 atom->ul = stats->SMBmove_time;
1330                 break;
1331             case 144:                   /* SMB.SMB_echo */
1332                 atom->ul = stats->SMBecho_count;
1333                 break;
1334             case 145:                   /* SMB.SMB_echo */
1335                 atom->ul = stats->SMBecho_time;
1336                 break;
1337             case 146:                   /* SMB.SMB_writeclose */
1338                 atom->ul = stats->SMBwriteclose_count;
1339                 break;
1340             case 147:                   /* SMB.SMB_writeclose */
1341                 atom->ul = stats->SMBwriteclose_time;
1342                 break;
1343             case 148:                   /* SMB.SMB_openX */
1344                 atom->ul = stats->SMBopenX_count;
1345                 break;
1346             case 149:                   /* SMB.SMB_openX */
1347                 atom->ul = stats->SMBopenX_time;
1348                 break;
1349             case 150:                   /* SMB.SMB_readX */
1350                 atom->ul = stats->SMBreadX_count;
1351                 break;
1352             case 151:                   /* SMB.SMB_readX */
1353                 atom->ul = stats->SMBreadX_time;
1354                 break;
1355             case 152:                   /* SMB.SMB_writeX */
1356                 atom->ul = stats->SMBwriteX_count;
1357                 break;
1358             case 153:                   /* SMB.SMB_writeX */
1359                 atom->ul = stats->SMBwriteX_time;
1360                 break;
1361             case 154:                   /* SMB.SMB_trans2 */
1362                 atom->ul = stats->SMBtrans2_count;
1363                 break;
1364             case 155:                   /* SMB.SMB_trans2 */
1365                 atom->ul = stats->SMBtrans2_time;
1366                 break;
1367             case 156:                   /* SMB.SMB_transs2 */
1368                 atom->ul = stats->SMBtranss2_count;
1369                 break;
1370             case 157:                   /* SMB.SMB_transs2 */
1371                 atom->ul = stats->SMBtranss2_time;
1372                 break;
1373             case 158:                   /* SMB.SMB_findclose */
1374                 atom->ul = stats->SMBfindclose_count;
1375                 break;
1376             case 159:                   /* SMB.SMB_findclose */
1377                 atom->ul = stats->SMBfindclose_time;
1378                 break;
1379             case 160:                   /* SMB.SMB_findnclose */
1380                 atom->ul = stats->SMBfindnclose_count;
1381                 break;
1382             case 161:                   /* SMB.SMB_findnclose */
1383                 atom->ul = stats->SMBfindnclose_time;
1384                 break;
1385             case 162:                   /* SMB.SMB_tcon */
1386                 atom->ul = stats->SMBtcon_count;
1387                 break;
1388             case 163:                   /* SMB.SMB_tcon */
1389                 atom->ul = stats->SMBtcon_time;
1390                 break;
1391             case 164:                   /* SMB.SMB_tdis */
1392                 atom->ul = stats->SMBtdis_count;
1393                 break;
1394             case 165:                   /* SMB.SMB_tdis */
1395                 atom->ul = stats->SMBtdis_time;
1396                 break;
1397             case 166:                   /* SMB.SMB_negprot */
1398                 atom->ul = stats->SMBnegprot_count;
1399                 break;
1400             case 167:                   /* SMB.SMB_negprot */
1401                 atom->ul = stats->SMBnegprot_time;
1402                 break;
1403             case 168:                   /* SMB.SMB_sesssetupX */
1404                 atom->ul = stats->SMBsesssetupX_count;
1405                 break;
1406             case 169:                   /* SMB.SMB_sesssetupX */
1407                 atom->ul = stats->SMBsesssetupX_time;
1408                 break;
1409             case 170:                   /* SMB.SMB_ulogoffX */
1410                 atom->ul = stats->SMBulogoffX_count;
1411                 break;
1412             case 171:                   /* SMB.SMB_ulogoffX */
1413                 atom->ul = stats->SMBulogoffX_time;
1414                 break;
1415             case 172:                   /* SMB.SMB_tconX */
1416                 atom->ul = stats->SMBtconX_count;
1417                 break;
1418             case 173:                   /* SMB.SMB_tconX */
1419                 atom->ul = stats->SMBtconX_time;
1420                 break;
1421             case 174:                   /* SMB.SMB_dskattr */
1422                 atom->ul = stats->SMBdskattr_count;
1423                 break;
1424             case 175:                   /* SMB.SMB_dskattr */
1425                 atom->ul = stats->SMBdskattr_time;
1426                 break;
1427             case 176:                   /* SMB.SMB_search */
1428                 atom->ul = stats->SMBsearch_count;
1429                 break;
1430             case 177:                   /* SMB.SMB_search */
1431                 atom->ul = stats->SMBsearch_time;
1432                 break;
1433             case 178:                   /* SMB.SMB_ffirst */
1434                 atom->ul = stats->SMBffirst_count;
1435                 break;
1436             case 179:                   /* SMB.SMB_ffirst */
1437                 atom->ul = stats->SMBffirst_time;
1438                 break;
1439             case 180:                   /* SMB.SMB_funique */
1440                 atom->ul = stats->SMBfunique_count;
1441                 break;
1442             case 181:                   /* SMB.SMB_funique */
1443                 atom->ul = stats->SMBfunique_time;
1444                 break;
1445             case 182:                   /* SMB.SMB_fclose */
1446                 atom->ul = stats->SMBfclose_count;
1447                 break;
1448             case 183:                   /* SMB.SMB_fclose */
1449                 atom->ul = stats->SMBfclose_time;
1450                 break;
1451             case 184:                   /* SMB.SMB_nttrans */
1452                 atom->ul = stats->SMBnttrans_count;
1453                 break;
1454             case 185:                   /* SMB.SMB_nttrans */
1455                 atom->ul = stats->SMBnttrans_time;
1456                 break;
1457             case 186:                   /* SMB.SMB_nttranss */
1458                 atom->ul = stats->SMBnttranss_count;
1459                 break;
1460             case 187:                   /* SMB.SMB_nttranss */
1461                 atom->ul = stats->SMBnttranss_time;
1462                 break;
1463             case 188:                   /* SMB.SMB_ntcreateX */
1464                 atom->ul = stats->SMBntcreateX_count;
1465                 break;
1466             case 189:                   /* SMB.SMB_ntcreateX */
1467                 atom->ul = stats->SMBntcreateX_time;
1468                 break;
1469             case 190:                   /* SMB.SMB_ntcancel */
1470                 atom->ul = stats->SMBntcancel_count;
1471                 break;
1472             case 191:                   /* SMB.SMB_ntcancel */
1473                 atom->ul = stats->SMBntcancel_time;
1474                 break;
1475             case 192:                   /* SMB.SMB_splopen */
1476                 atom->ul = stats->SMBsplopen_count;
1477                 break;
1478             case 193:                   /* SMB.SMB_splopen */
1479                 atom->ul = stats->SMBsplopen_time;
1480                 break;
1481             case 194:                   /* SMB.SMB_splwrite */
1482                 atom->ul = stats->SMBsplwr_count;
1483                 break;
1484             case 195:                   /* SMB.SMB_splwrite */
1485                 atom->ul = stats->SMBsplwr_time;
1486                 break;
1487             case 196:                   /* SMB.SMB_splclose */
1488                 atom->ul = stats->SMBsplclose_count;
1489                 break;
1490             case 197:                   /* SMB.SMB_splclose */
1491                 atom->ul = stats->SMBsplclose_time;
1492                 break;
1493             case 198:                   /* SMB.SMB_splretq */
1494                 atom->ul = stats->SMBsplretq_count;
1495                 break;
1496             case 199:                   /* SMB.SMB_splretq */
1497                 atom->ul = stats->SMBsplretq_time;
1498                 break;
1499             case 200:                   /* SMB.SMB_sends */
1500                 atom->ul = stats->SMBsends_count;
1501                 break;
1502             case 201:                   /* SMB.SMB_sends */
1503                 atom->ul = stats->SMBsends_time;
1504                 break;
1505             case 202:                   /* SMB.SMB_sendb */
1506                 atom->ul = stats->SMBsendb_count;
1507                 break;
1508             case 203:                   /* SMB.SMB_sendb */
1509                 atom->ul = stats->SMBsendb_time;
1510                 break;
1511             case 204:                   /* SMB.SMB_fwdname */
1512                 atom->ul = stats->SMBfwdname_count;
1513                 break;
1514             case 205:                   /* SMB.SMB_fwdname */
1515                 atom->ul = stats->SMBfwdname_time;
1516                 break;
1517             case 206:                   /* SMB.SMB_cancelf */
1518                 atom->ul = stats->SMBcancelf_count;
1519                 break;
1520             case 207:                   /* SMB.SMB_cancelf */
1521                 atom->ul = stats->SMBcancelf_time;
1522                 break;
1523             case 208:                   /* SMB.SMB_getmach */
1524                 atom->ul = stats->SMBgetmac_count;
1525                 break;
1526             case 209:                   /* SMB.SMB_getmach */
1527                 atom->ul = stats->SMBgetmac_time;
1528                 break;
1529             case 210:                   /* SMB.SMB_sendstrt */
1530                 atom->ul = stats->SMBsendstrt_count;
1531                 break;
1532             case 211:                   /* SMB.SMB_sendstrt */
1533                 atom->ul = stats->SMBsendstrt_time;
1534                 break;
1535             case 212:                   /* SMB.SMB_sendend */
1536                 atom->ul = stats->SMBsendend_count;
1537                 break;
1538             case 213:                   /* SMB.SMB_sendend */
1539                 atom->ul = stats->SMBsendend_time;
1540                 break;
1541             case 214:                   /* SMB.SMB_sendtxt */
1542                 atom->ul = stats->SMBsendtxt_count;
1543                 break;
1544             case 215:                   /* SMB.SMB_sendtxt */
1545                 atom->ul = stats->SMBsendtxt_time;
1546                 break;
1547             case 216:                   /* SMB.SMB_invalid */
1548                 atom->ul = stats->SMBinvalid_count;
1549                 break;
1550             case 217:                   /* SMB.SMB_invalid */
1551                 atom->ul = stats->SMBinvalid_time;
1552                 break;
1553             case 218:                   /* SMB.PATHWORK_setdir */
1554                 atom->ul = stats->pathworks_setdir_count;
1555                 break;
1556             case 219:                   /* SMB.PATHWORK_setdir */
1557                 atom->ul = stats->pathworks_setdir_time;
1558                 break;
1559             case 220:                   /* SMB.TRANS2_open */
1560                 atom->ul = stats->Trans2_open_count;
1561                 break;
1562             case 221:                   /* SMB.TRANS2_open */
1563                 atom->ul = stats->Trans2_open_time;
1564                 break;
1565             case 222:                   /* SMB.TRANS2_findfirst */
1566                 atom->ul = stats->Trans2_findfirst_count;
1567                 break;
1568             case 223:                   /* SMB.TRANS2_findfirst */
1569                 atom->ul = stats->Trans2_findfirst_time;
1570                 break;
1571             case 224:                   /* SMB.TRANS2_findnext */
1572                 atom->ul = stats->Trans2_findnext_count;
1573                 break;
1574             case 225:                   /* SMB.TRANS2_findnext */
1575                 atom->ul = stats->Trans2_findnext_time;
1576                 break;
1577             case 226:                   /* SMB.TRANS2_qfsinfo */
1578                 atom->ul = stats->Trans2_qfsinfo_count;
1579                 break;
1580             case 227:                   /* SMB.TRANS2_qfsinfo */
1581                 atom->ul = stats->Trans2_qfsinfo_time;
1582                 break;
1583             case 228:                   /* SMB.TRANS2_setfsinfo */
1584                 atom->ul = stats->Trans2_setfsinfo_count;
1585                 break;
1586             case 229:                   /* SMB.TRANS2_setfsinfo */
1587                 atom->ul = stats->Trans2_setfsinfo_time;
1588                 break;
1589             case 230:                   /* SMB.TRANS2_qpathinfo */
1590                 atom->ul = stats->Trans2_qpathinfo_count;
1591                 break;
1592             case 231:                   /* SMB.TRANS2_qpathinfo */
1593                 atom->ul = stats->Trans2_qpathinfo_time;
1594                 break;
1595             case 232:                   /* SMB.TRANS2_setpathinfo */
1596                 atom->ul = stats->Trans2_setpathinfo_count;
1597                 break;
1598             case 233:                   /* SMB.TRANS2_setpathinfo */
1599                 atom->ul = stats->Trans2_setpathinfo_time;
1600                 break;
1601             case 234:                   /* SMB.TRANS2_qfileinfo */
1602                 atom->ul = stats->Trans2_qfileinfo_count;
1603                 break;
1604             case 235:                   /* SMB.TRANS2_qfileinfo */
1605                 atom->ul = stats->Trans2_qfileinfo_time;
1606                 break;
1607             case 236:                   /* SMB.TRANS2_setfileinfo */
1608                 atom->ul = stats->Trans2_setfileinfo_count;
1609                 break;
1610             case 237:                   /* SMB.TRANS2_setfileinfo */
1611                 atom->ul = stats->Trans2_setfileinfo_time;
1612                 break;
1613             case 238:                   /* SMB.TRANS2_fsctl */
1614                 atom->ul = stats->Trans2_fsctl_count;
1615                 break;
1616             case 239:                   /* SMB.TRANS2_fsctl */
1617                 atom->ul = stats->Trans2_fsctl_time;
1618                 break;
1619             case 240:                   /* SMB.TRANS2_ioctl */
1620                 atom->ul = stats->Trans2_ioctl_count;
1621                 break;
1622             case 241:                   /* SMB.TRANS2_ioctl */
1623                 atom->ul = stats->Trans2_ioctl_time;
1624                 break;
1625             case 242:                   /* SMB.TRANS2_findnotifyfirst */
1626                 atom->ul = stats->Trans2_findnotifyfirst_count;
1627                 break;
1628             case 243:                   /* SMB.TRANS2_findnotifyfirst */
1629                 atom->ul = stats->Trans2_findnotifyfirst_time;
1630                 break;
1631             case 244:                   /* SMB.TRANS2_findnotifynext */
1632                 atom->ul = stats->Trans2_findnotifynext_count;
1633                 break;
1634             case 245:                   /* SMB.TRANS2_findnotifynext */
1635                 atom->ul = stats->Trans2_findnotifynext_time;
1636                 break;
1637             case 246:                   /* SMB.TRANS2_mkdir */
1638                 atom->ul = stats->Trans2_mkdir_count;
1639                 break;
1640             case 247:                   /* SMB.TRANS2_mkdir */
1641                 atom->ul = stats->Trans2_mkdir_time;
1642                 break;
1643             case 248:                   /* SMB.TRANS2_session_setup */
1644                 atom->ul = stats->Trans2_session_setup_count;
1645                 break;
1646             case 249:                   /* SMB.TRANS2_session_setup */
1647                 atom->ul = stats->Trans2_session_setup_time;
1648                 break;
1649             case 250:                   /* SMB.TRANS2_get_dfs_referral */
1650                 atom->ul = stats->Trans2_get_dfs_referral_count;
1651                 break;
1652             case 251:                   /* SMB.TRANS2_get_dfs_referral */
1653                 atom->ul = stats->Trans2_get_dfs_referral_time;
1654                 break;
1655             case 252:                   /* SMB.TRANS2_report_dfs_inconsistancy */
1656                 atom->ul = stats->Trans2_report_dfs_inconsistancy_count;
1657                 break;
1658             case 253:                   /* SMB.TRANS2_report_dfs_inconsistancy */
1659                 atom->ul = stats->Trans2_report_dfs_inconsistancy_time;
1660                 break;
1661             case 254:                   /* SMB.NTTRANS_create */
1662                 atom->ul = stats->NT_transact_create_count;
1663                 break;
1664             case 255:                   /* SMB.NTTRANS_create */
1665                 atom->ul = stats->NT_transact_create_time;
1666                 break;
1667             case 256:                   /* SMB.NTTRANS_ioctl */
1668                 atom->ul = stats->NT_transact_ioctl_count;
1669                 break;
1670             case 257:                   /* SMB.NTTRANS_ioctl */
1671                 atom->ul = stats->NT_transact_ioctl_time;
1672                 break;
1673             case 258:                   /* SMB.NTTRANS_set_security_desc */
1674                 atom->ul = stats->NT_transact_set_security_desc_count;
1675                 break;
1676             case 259:                   /* SMB.NTTRANS_set_security_desc */
1677                 atom->ul = stats->NT_transact_set_security_desc_time;
1678                 break;
1679             case 260:                   /* SMB.NTTRANS_notify_change */
1680                 atom->ul = stats->NT_transact_notify_change_count;
1681                 break;
1682             case 261:                   /* SMB.NTTRANS_notify_change */
1683                 atom->ul = stats->NT_transact_notify_change_time;
1684                 break;
1685             case 262:                   /* SMB.NTTRANS_rename */
1686                 atom->ul = stats->NT_transact_rename_count;
1687                 break;
1688             case 263:                   /* SMB.NTTRANS_rename */
1689                 atom->ul = stats->NT_transact_rename_time;
1690                 break;
1691             case 264:                   /* SMB.NTTRANS_query_security_desc */
1692                 atom->ul = stats->NT_transact_query_security_desc_count;
1693                 break;
1694             case 265:                   /* SMB.NTTRANS_query_security_desc */
1695                 atom->ul = stats->NT_transact_query_security_desc_time;
1696                 break;
1697             default:
1698                 return PM_ERR_PMID;
1699         }
1700     }
1701     else
1702         return PM_ERR_PMID;
1703     return 0;
1704 }
1705
1706
1707 void 
1708 samba_init(pmdaInterface *dp)
1709 {
1710     if (dp->status != 0)
1711         return;
1712
1713     pmdaSetFetchCallBack(dp, samba_fetchCallBack);
1714     pmdaInit(dp, NULL, 0, metrictab, sizeof(metrictab)/sizeof(metrictab[0]));
1715
1716     if ((shmid = shmget(PROF_SHMEM_KEY, 0, 0)) == -1) {
1717         fprintf(stderr, "shmid: %s\n", strerror(errno));
1718         fprintf(stderr, "samba not compiled with profile support or not running\n");
1719         exit(1);
1720     }
1721     shmheader = (struct profile_header *)shmat(shmid, NULL, SHM_RDONLY);
1722     if ((int)shmheader == -1) {
1723         fprintf(stderr, "shmat: %s\n", strerror(errno));
1724         exit(1);
1725     }
1726
1727     /* validate the data */
1728     if (!shmheader)     /* not mapped yet */
1729         fprintf(stderr, "samba_init: shmem not mapped\n");
1730     else if (shmheader->prof_shm_magic != PROF_SHM_MAGIC)
1731         fprintf(stderr, "samba_init: bad magic\n");
1732     else if (shmheader->prof_shm_version != PROF_SHM_VERSION)
1733         fprintf(stderr, "samba_init: bad version %X\n",
1734                         shmheader->prof_shm_version);
1735     else {
1736         stats = &shmheader->stats;
1737         return;         /* looks OK */
1738     }
1739     exit(1);
1740 }
1741
1742
1743 int
1744 main(int argc, char **argv)
1745 {
1746     int                 err = 0;
1747     char                *p;
1748     pmdaInterface       dispatch;
1749
1750     for (p = pmProgname = argv[0]; *p; p++)
1751         if (*p == '/') pmProgname = p+1;
1752
1753     pmdaDaemon(&dispatch, PMDA_INTERFACE_2, pmProgname, SAMBA,
1754                 "samba.log", "/var/pcp/pmdas/samba/help");
1755
1756     if (pmdaGetOpt(argc, argv, "D:d:l:?", &dispatch, &err) != EOF) {
1757         fprintf(stderr, "Usage: %s [options]\n\n\
1758 Options:\n\
1759   -d domain    use domain (numeric) for metrics domain of PMDA\n\
1760   -l logfile   write log into logfile rather than using default log name\n",
1761         pmProgname);
1762         exit(1);
1763     }
1764
1765     pmdaOpenLog(&dispatch);
1766     samba_init(&dispatch);
1767     pmdaConnect(&dispatch);
1768     pmdaMain(&dispatch);
1769
1770     exit(0);
1771     /*NOTREACHED*/
1772 }