From 745508e3c0d7e4304a06322d22a0e906b3c81ff4 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 11:18:25 -0700 Subject: [PATCH 1/7] update eclipse project classpath --- bindings/java/.classpath | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bindings/java/.classpath b/bindings/java/.classpath index 79cdada9..8432ad50 100644 --- a/bindings/java/.classpath +++ b/bindings/java/.classpath @@ -3,11 +3,10 @@ - + + - - From 5324c6f235e72f714eb8bbaec554cd6ff97b97ea Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:21:47 -0700 Subject: [PATCH 2/7] mv to sigar-stuff --- src/os/win32/counter_names.txt | 820 --------------------------------- 1 file changed, 820 deletions(-) delete mode 100644 src/os/win32/counter_names.txt diff --git a/src/os/win32/counter_names.txt b/src/os/win32/counter_names.txt deleted file mode 100644 index b125b043..00000000 --- a/src/os/win32/counter_names.txt +++ /dev/null @@ -1,820 +0,0 @@ -#counter names from registry key -#SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib -0 UNDEFINED -1 1847 -2 System -4 Memory -6 % Processor Time -10 File Read Operations/sec -12 File Write Operations/sec -14 File Control Operations/sec -16 File Read Bytes/sec -18 File Write Bytes/sec -20 File Control Bytes/sec -24 Available Bytes -26 Committed Bytes -28 Page Faults/sec -30 Commit Limit -32 Write Copies/sec -34 Transition Faults/sec -36 Cache Faults/sec -38 Demand Zero Faults/sec -40 Pages/sec -42 Page Reads/sec -44 Processor Queue Length -46 Thread State -48 Pages Output/sec -50 Page Writes/sec -52 Browser -54 Announcements Server/sec -56 Pool Paged Bytes -58 Pool Nonpaged Bytes -60 Pool Paged Allocs -64 Pool Nonpaged Allocs -66 Pool Paged Resident Bytes -68 System Code Total Bytes -70 System Code Resident Bytes -72 System Driver Total Bytes -74 System Driver Resident Bytes -76 System Cache Resident Bytes -78 Announcements Domain/sec -80 Election Packets/sec -82 Mailslot Writes/sec -84 Server List Requests/sec -86 Cache -88 Data Maps/sec -90 Sync Data Maps/sec -92 Async Data Maps/sec -94 Data Map Hits % -96 Data Map Pins/sec -98 Pin Reads/sec -100 Sync Pin Reads/sec -102 Async Pin Reads/sec -104 Pin Read Hits % -106 Copy Reads/sec -108 Sync Copy Reads/sec -110 Async Copy Reads/sec -112 Copy Read Hits % -114 MDL Reads/sec -116 Sync MDL Reads/sec -118 Async MDL Reads/sec -120 MDL Read Hits % -122 Read Aheads/sec -124 Fast Reads/sec -126 Sync Fast Reads/sec -128 Async Fast Reads/sec -130 Fast Read Resource Misses/sec -132 Fast Read Not Possibles/sec -134 Lazy Write Flushes/sec -136 Lazy Write Pages/sec -138 Data Flushes/sec -140 Data Flush Pages/sec -142 % User Time -144 % Privileged Time -146 Context Switches/sec -148 Interrupts/sec -150 System Calls/sec -152 Level 1 TLB Fills/sec -154 Level 2 TLB Fills/sec -156 Enumerations Server/sec -158 Enumerations Domain/sec -160 Enumerations Other/sec -162 Missed Server Announcements -164 Missed Mailslot Datagrams -166 Missed Server List Requests -168 Server Announce Allocations Failed/sec -170 Mailslot Allocations Failed -172 Virtual Bytes Peak -174 Virtual Bytes -178 Working Set Peak -180 Working Set -182 Page File Bytes Peak -184 Page File Bytes -186 Private Bytes -188 Announcements Total/sec -190 Enumerations Total/sec -198 Current Disk Queue Length -200 % Disk Time -202 % Disk Read Time -204 % Disk Write Time -206 Avg. Disk sec/Transfer -208 Avg. Disk sec/Read -210 Avg. Disk sec/Write -212 Disk Transfers/sec -214 Disk Reads/sec -216 Disk Writes/sec -218 Disk Bytes/sec -220 Disk Read Bytes/sec -222 Disk Write Bytes/sec -224 Avg. Disk Bytes/Transfer -226 Avg. Disk Bytes/Read -228 Avg. Disk Bytes/Write -230 Process -232 Thread -234 PhysicalDisk -236 LogicalDisk -238 Processor -240 % Total Processor Time -242 % Total User Time -244 % Total Privileged Time -246 Total Interrupts/sec -248 Processes -250 Threads -252 Events -254 Semaphores -256 Mutexes -258 Sections -260 Objects -262 Redirector -264 Bytes Received/sec -266 Packets Received/sec -268 Read Bytes Paging/sec -270 Read Bytes Non-Paging/sec -272 Read Bytes Cache/sec -274 Read Bytes Network/sec -276 Bytes Transmitted/sec -278 Packets Transmitted/sec -280 Write Bytes Paging/sec -282 Write Bytes Non-Paging/sec -284 Write Bytes Cache/sec -286 Write Bytes Network/sec -288 Read Operations/sec -290 Read Operations Random/sec -292 Read Packets/sec -294 Reads Large/sec -296 Read Packets Small/sec -298 Write Operations/sec -300 Write Operations Random/sec -302 Write Packets/sec -304 Writes Large/sec -306 Write Packets Small/sec -308 Reads Denied/sec -310 Writes Denied/sec -312 Network Errors/sec -314 Server Sessions -316 Server Reconnects -318 Connects Core -320 Connects Lan Manager 2.0 -322 Connects Lan Manager 2.1 -324 Connects Windows NT -326 Server Disconnects -328 Server Sessions Hung -330 Server -336 Thread Wait Reason -340 Sessions Timed Out -342 Sessions Errored Out -344 Sessions Logged Off -346 Sessions Forced Off -348 Errors Logon -350 Errors Access Permissions -352 Errors Granted Access -354 Errors System -356 Blocking Requests Rejected -358 Work Item Shortages -360 Files Opened Total -362 Files Open -366 File Directory Searches -370 Pool Nonpaged Failures -372 Pool Nonpaged Peak -376 Pool Paged Failures -378 Pool Paged Peak -388 Bytes Total/sec -392 Current Commands -398 NWLink NetBIOS -400 Packets/sec -404 Context Blocks Queued/sec -406 File Data Operations/sec -408 % Free Space -410 Free Megabytes -412 Connections Open -414 Connections No Retries -416 Connections With Retries -418 Disconnects Local -420 Disconnects Remote -422 Failures Link -424 Failures Adapter -426 Connection Session Timeouts -428 Connections Canceled -430 Failures Resource Remote -432 Failures Resource Local -434 Failures Not Found -436 Failures No Listen -438 Datagrams/sec -440 Datagram Bytes/sec -442 Datagrams Sent/sec -444 Datagram Bytes Sent/sec -446 Datagrams Received/sec -448 Datagram Bytes Received/sec -452 Packets Sent/sec -456 Frames/sec -458 Frame Bytes/sec -460 Frames Sent/sec -462 Frame Bytes Sent/sec -464 Frames Received/sec -466 Frame Bytes Received/sec -468 Frames Re-Sent/sec -470 Frame Bytes Re-Sent/sec -472 Frames Rejected/sec -474 Frame Bytes Rejected/sec -476 Expirations Response -478 Expirations Ack -480 Window Send Maximum -482 Window Send Average -484 Piggyback Ack Queued/sec -486 Piggyback Ack Timeouts -488 NWLink IPX -490 NWLink SPX -492 NetBEUI -494 NetBEUI Resource -496 Used Maximum -498 Used Average -500 Times Exhausted -502 NBT Connection -506 Bytes Sent/sec -508 Total Bytes/sec -510 Network Interface -512 Bytes/sec -520 Current Bandwidth -524 Packets Received Unicast/sec -526 Packets Received Non-Unicast/sec -528 Packets Received Discarded -530 Packets Received Errors -532 Packets Received Unknown -536 Packets Sent Unicast/sec -538 Packets Sent Non-Unicast/sec -540 Packets Outbound Discarded -542 Packets Outbound Errors -544 Output Queue Length -546 IP -552 Datagrams Received Header Errors -554 Datagrams Received Address Errors -556 Datagrams Forwarded/sec -558 Datagrams Received Unknown Protocol -560 Datagrams Received Discarded -562 Datagrams Received Delivered/sec -566 Datagrams Outbound Discarded -568 Datagrams Outbound No Route -570 Fragments Received/sec -572 Fragments Re-assembled/sec -574 Fragment Re-assembly Failures -576 Fragmented Datagrams/sec -578 Fragmentation Failures -580 Fragments Created/sec -582 ICMP -584 Messages/sec -586 Messages Received/sec -588 Messages Received Errors -590 Received Dest. Unreachable -592 Received Time Exceeded -594 Received Parameter Problem -596 Received Source Quench -598 Received Redirect/sec -600 Received Echo/sec -602 Received Echo Reply/sec -604 Received Timestamp/sec -606 Received Timestamp Reply/sec -608 Received Address Mask -610 Received Address Mask Reply -612 Messages Sent/sec -614 Messages Outbound Errors -616 Sent Destination Unreachable -618 Sent Time Exceeded -620 Sent Parameter Problem -622 Sent Source Quench -624 Sent Redirect/sec -626 Sent Echo/sec -628 Sent Echo Reply/sec -630 Sent Timestamp/sec -632 Sent Timestamp Reply/sec -634 Sent Address Mask -636 Sent Address Mask Reply -638 TCP -640 Segments/sec -642 Connections Established -644 Connections Active -646 Connections Passive -648 Connection Failures -650 Connections Reset -652 Segments Received/sec -654 Segments Sent/sec -656 Segments Retransmitted/sec -658 UDP -660 % Total DPC Time -662 % Total Interrupt Time -664 Datagrams No Port/sec -666 Datagrams Received Errors -670 Disk Storage Unit -672 Allocation Failures -674 System Up Time -676 System Handle Count -678 Free System Page Table Entries -680 Thread Count -682 Priority Base -684 Elapsed Time -686 Alignment Fixups/sec -688 Exception Dispatches/sec -690 Floating Emulations/sec -692 Logon/sec -694 Priority Current -696 % DPC Time -698 % Interrupt Time -700 Paging File -702 % Usage -704 % Usage Peak -706 Start Address -708 User PC -710 Mapped Space No Access -712 Mapped Space Read Only -714 Mapped Space Read/Write -716 Mapped Space Write Copy -718 Mapped Space Executable -720 Mapped Space Exec Read Only -722 Mapped Space Exec Read/Write -724 Mapped Space Exec Write Copy -726 Reserved Space No Access -728 Reserved Space Read Only -730 Reserved Space Read/Write -732 Reserved Space Write Copy -734 Reserved Space Executable -736 Reserved Space Exec Read Only -738 Reserved Space Exec Read/Write -740 Image -742 Reserved Space Exec Write Copy -744 Unassigned Space No Access -746 Unassigned Space Read Only -748 Unassigned Space Read/Write -750 Unassigned Space Write Copy -752 Unassigned Space Executable -754 Unassigned Space Exec Read Only -756 Unassigned Space Exec Read/Write -758 Unassigned Space Exec Write Copy -760 Image Space No Access -762 Image Space Read Only -764 Image Space Read/Write -766 Image Space Write Copy -768 Image Space Executable -770 Image Space Exec Read Only -772 Image Space Exec Read/Write -774 Image Space Exec Write Copy -776 Bytes Image Reserved -778 Bytes Image Free -780 Bytes Reserved -782 Bytes Free -784 ID Process -786 Process Address Space -788 No Access -790 Read Only -792 Read/Write -794 Write Copy -796 Executable -798 Exec Read Only -800 Exec Read/Write -802 Exec Write Copy -804 ID Thread -806 Mailslot Receives Failed -808 Mailslot Writes Failed -810 Mailslot Opens Failed/sec -812 Duplicate Master Announcements -814 Illegal Datagrams/sec -816 Thread Details -818 Cache Bytes -820 Cache Bytes Peak -822 Pages Input/sec -870 RAS Port -872 Bytes Transmitted -874 Bytes Received -876 Frames Transmitted -878 Frames Received. -880 Percent Compression Out -882 Percent Compression In -884 CRC Errors -886 Timeout Errors -888 Serial Overrun Errors -890 Alignment Errors -892 Buffer Overrun Errors -894 Total Errors -896 Bytes Transmitted/Sec -898 Bytes Received/Sec -900 Frames Transmitted/Sec -902 Frames Received/Sec -904 Total Errors/Sec -906 RAS Total -908 Total Connections -920 WINS Server -922 Unique Registrations/sec -924 Group Registrations/sec -926 Total Number of Registrations/sec -928 Unique Renewals/sec -930 Group Renewals/sec -932 Total Number of Renewals/sec -934 Releases/sec -936 Queries/sec -938 Unique Conflicts/sec -940 Group Conflicts/sec -942 Total Number of Conflicts/sec -944 Successful Releases/sec -946 Failed Releases/sec -948 Successful Queries/sec -950 Failed Queries/sec -952 Handle Count -1000 MacFile Server -1002 Max Paged Memory -1004 Current Paged Memory -1006 Max NonPaged Memory -1008 Current NonPaged memory -1010 Current Sessions -1012 Maximum Sessions -1014 Current Files Open -1016 Maximum Files Open -1018 Failed Logons -1020 Data Read/sec -1022 Data Written/sec -1024 Data Received/sec -1026 Data Transmitted/sec -1028 Current Queue Length -1030 Maximum Queue Length -1032 Current Threads -1034 Maximum Threads -1050 AppleTalk -1052 Packets In/sec -1054 Packets Out/sec -1056 Bytes In/sec -1058 Bytes Out/sec -1060 Average Time/DDP Packet -1062 DDP Packets/sec -1064 Average Time/AARP Packet -1066 AARP Packets/sec -1068 Average Time/ATP Packet -1070 ATP Packets/sec -1072 Average Time/NBP Packet -1074 NBP Packets/sec -1076 Average Time/ZIP Packet -1078 ZIP Packets/sec -1080 Average Time/RTMP Packet -1082 RTMP Packets/sec -1084 ATP Retries Local -1086 ATP Response Timouts -1088 ATP XO Response/Sec -1090 ATP ALO Response/Sec -1092 ATP Recvd Release/Sec -1094 Current NonPaged Pool -1096 Packets Routed In/Sec -1098 Packets dropped -1100 ATP Retries Remote -1102 Packets Routed Out/Sec -1110 Network Segment -1112 Total frames received/second -1114 Total bytes received/second -1116 Broadcast frames received/second -1118 Multicast frames received/second -1120 % Network utilization -1124 % Broadcast Frames -1126 % Multicast Frames -1150 Telephony -1152 Lines -1154 Telephone Devices -1156 Active Lines -1158 Active Telephones -1160 Outgoing Calls/sec -1162 Incoming Calls/sec -1164 Client Apps -1166 Current Outgoing Calls -1168 Current Incoming Calls -1228 Gateway Service For NetWare -1230 Client Service For NetWare -1232 Packet Burst Read NCP Count/sec -1234 Packet Burst Read Timeouts/sec -1236 Packet Burst Write NCP Count/sec -1238 Packet Burst Write Timeouts/sec -1240 Packet Burst IO/sec -1242 Connect NetWare 2.x -1244 Connect NetWare 3.x -1246 Connect NetWare 4.x -1260 Logon Total -1300 Server Work Queues -1302 Queue Length -1304 Active Threads -1306 Available Threads -1308 Available Work Items -1310 Borrowed Work Items -1312 Work Item Shortages -1314 Current Clients -1320 Bytes Transferred/sec -1324 Read Bytes/sec -1328 Write Bytes/sec -1332 Total Operations/sec -1334 DPCs Queued/sec -1336 DPC Rate -1342 Total DPCs Queued/sec -1344 Total DPC Rate -1350 % Registry Quota In Use -1360 VL Memory -1362 VLM % Virtual Size In Use -1364 VLM Virtual Size -1366 VLM Virtual Size Peak -1368 VLM Virtual Size Available -1370 VLM Commit Charge -1372 VLM Commit Charge Peak -1374 System VLM Commit Charge -1376 System VLM Commit Charge Peak -1378 System VLM Shared Commit Charge -1380 Available KBytes -1382 Available MBytes -1400 Avg. Disk Queue Length -1402 Avg. Disk Read Queue Length -1404 Avg. Disk Write Queue Length -1406 % Committed Bytes In Use -1408 Full Image -1410 Creating Process ID -1412 IO Read Operations/sec -1414 IO Write Operations/sec -1416 IO Data Operations/sec -1418 IO Other Operations/sec -1420 IO Read Bytes/sec -1422 IO Write Bytes/sec -1424 IO Data Bytes/sec -1426 IO Other Bytes/sec -1450 Print Queue -1452 Total Jobs Printed -1454 Bytes Printed/sec -1456 Total Pages Printed -1458 Jobs -1460 References -1462 Max References -1464 Jobs Spooling -1466 Max Jobs Spooling -1468 Out of Paper Errors -1470 Not Ready Errors -1472 Job Errors -1474 Enumerate Network Printer Calls -1476 Add Network Printer Calls -1478 Working Set - Private -1480 Working Set - Shared -1482 % Idle Time -1484 Split IO/Sec -1500 Job Object -1502 Current % Processor Time -1504 Current % User Mode Time -1506 Current % Kernel Mode Time -1508 This Period mSec - Processor -1510 This Period mSec - User Mode -1512 This Period mSec - Kernel Mode -1514 Pages/Sec -1516 Process Count - Total -1518 Process Count - Active -1520 Process Count - Terminated -1522 Total mSec - Processor -1524 Total mSec - User Mode -1526 Total mSec - Kernel Mode -1548 Job Object Details -1746 % Idle Time -1748 % C1 Time -1750 % C2 Time -1752 % C3 Time -1754 C1 Transitions/sec -1756 C2 Transitions/sec -1758 C3 Transitions/sec -1760 Heap -1762 Committed Bytes -1764 Reserved Bytes -1766 Virtual Bytes -1768 Free Bytes -1770 Free List Length -1772 Avg. alloc rate -1774 Avg. free rate -1776 Uncommitted Ranges Length -1778 Allocs - Frees -1780 Cached Allocs/sec -1782 Cached Frees/sec -1784 Allocs <1K/sec -1786 Frees <1K/sec -1788 Allocs 1-8K/sec -1790 Frees 1-8K/sec -1792 Allocs over 8K/sec -1794 Frees over 8K/sec -1796 Total Allocs/sec -1798 Total Frees/sec -1800 Blocks in Heap Cache -1802 Largest Cache Depth -1804 % Fragmentation -1806 % VAFragmentation -1808 Heap Lock contention -1846 End Marker -1848 RSVP Service -1850 Network Interfaces -1852 Network sockets -1854 Timers -1856 RSVP sessions -1858 QoS clients -1860 QoS-enabled senders -1862 QoS-enabled receivers -1864 Failed QoS requests -1866 Failed QoS sends -1868 QoS notifications -1870 Bytes in QoS notifications -1872 RSVP Interfaces -1874 Signaling bytes received -1876 Signaling bytes sent -1878 PATH messages received -1880 RESV messages received -1882 PATH ERR messages received -1884 RESV ERR messages received -1886 PATH TEAR messages received -1888 RESV TEAR messages received -1890 RESV CONFIRM messages received -1892 PATH messages sent -1894 RESV messages sent -1896 PATH ERR messages sent -1898 RESV ERR messages sent -1900 PATH TEAR messages sent -1902 RESV TEAR messages sent -1904 RESV CONFIRM messages sent -1906 Resource control failures -1908 Policy control failures -1910 General failures -1912 Blocked RESVs -1914 RESV state block timeouts -1916 PATH state block timeouts -1918 Send messages errors - Big messages -1920 Receive messages errors - Big messages -1922 Send messages errors - No memory -1924 Receive messages errors - No memory -1926 Number of incoming messages dropped -1928 Number of outgoing messages dropped -1930 Number of active flows -1932 Reserved bandwidth -1934 Maximum admitted bandwidth -1936 PSched Flow -1938 PSched Pipe -1940 Packets dropped -1942 Packets scheduled -1944 Packets transmitted -1946 Average packets in shaper -1948 Max packets in shaper -1950 Average packets in sequencer -1952 Max packets in sequencer -1954 Bytes scheduled -1956 Bytes transmitted -1958 Bytes transmitted/sec -1960 Bytes scheduled/sec -1962 Packets transmitted/sec -1964 Packets scheduled/sec -1966 Packets dropped/sec -1968 Nonconforming packets scheduled -1970 Nonconforming packets scheduled/sec -1972 Nonconforming packets transmitted -1974 Nonconforming packets transmitted/sec -1976 Maximum Packets in netcard -1978 Average Packets in netcard -1980 Out of packets -1982 Flows opened -1984 Flows closed -1986 Flows rejected -1988 Flows modified -1990 Flow mods rejected -1992 Max simultaneous flows -1994 Nonconforming packets scheduled -1996 Nonconforming packets scheduled/sec -1998 Nonconforming packets transmitted -2000 Nonconforming packets transmitted/sec -2002 Average packets in shaper -2004 Max packets in shaper -2006 Average packets in sequencer -2008 Max packets in sequencer -2010 Max packets in netcard -2012 Average packets in netcard -2014 RAS Port -2016 Bytes Transmitted -2018 Bytes Received -2020 Frames Transmitted -2022 Frames Received -2024 Percent Compression Out -2026 Percent Compression In -2028 CRC Errors -2030 Timeout Errors -2032 Serial Overrun Errors -2034 Alignment Errors -2036 Buffer Overrun Errors -2038 Total Errors -2040 Bytes Transmitted/Sec -2042 Bytes Received/Sec -2044 Frames Transmitted/Sec -2046 Frames Received/Sec -2048 Total Errors/Sec -2050 RAS Total -2052 Total Connections -2054 Terminal Services Session -2056 Input WdBytes -2058 Input WdFrames -2060 Input WaitForOutBuf -2062 Input Frames -2064 Input Bytes -2066 Input Compressed Bytes -2068 Input Compress Flushes -2070 Input Errors -2072 Input Timeouts -2074 Input Async Frame Error -2076 Input Async Overrun -2078 Input Async Overflow -2080 Input Async Parity Error -2082 Input Transport Errors -2084 Output WdBytes -2086 Output WdFrames -2088 Output WaitForOutBuf -2090 Output Frames -2092 Output Bytes -2094 Output Compressed Bytes -2096 Output Compress Flushes -2098 Output Errors -2100 Output Timeouts -2102 Output Async Frame Error -2104 Output Async Overrun -2106 Output Async Overflow -2108 Output Async Parity Error -2110 Output Transport Errors -2112 Total WdBytes -2114 Total WdFrames -2116 Total WaitForOutBuf -2118 Total Frames -2120 Total Bytes -2122 Total Compressed Bytes -2124 Total Compress Flushes -2126 Total Errors -2128 Total Timeouts -2130 Total Async Frame Error -2132 Total Async Overrun -2134 Total Async Overflow -2136 Total Async Parity Error -2138 Total Transport Errors -2140 Total Protocol Cache Reads -2142 Total Protocol Cache Hits -2144 Total Protocol Cache Hit Ratio -2146 Protocol Bitmap Cache Reads -2148 Protocol Bitmap Cache Hits -2150 Protocol Bitmap Cache Hit Ratio -2152 Protocol Glyph Cache Reads -2154 Protocol Glyph Cache Hits -2156 Protocol Glyph Cache Hit Ratio -2158 Protocol Brush Cache Reads -2160 Protocol Brush Cache Hits -2162 Protocol Brush Cache Hit Ratio -2164 Protocol Save Screen Bitmap Cache Reads -2166 Protocol Save Screen Bitmap Cache Hits -2168 Protocol Save Screen Bitmap Cache Hit Ratio -2170 Input Compression Ratio -2172 Output Compression Ratio -2174 Total Compression Ratio -2176 Terminal Services -2178 Total Sessions -2180 Active Sessions -2182 Inactive Sessions -2184 Distributed Transaction Coordinator -2186 Active Transactions -2188 Committed Transactions -2190 Aborted Transactions -2192 In Doubt Transactions -2194 Active Transactions Maximum -2196 Force Committed Transactions -2198 Force Aborted Transactions -2200 Response Time -- Minimum -2202 Response Time -- Average -2204 Response Time -- Maximum -2206 Transactions/sec -2208 Committed Transactions/sec -2210 Aborted Transactions/sec -2212 Indexing Service -2214 Word lists -2216 Saved indexes -2218 Index size (MB) -2220 Files to be indexed -2222 Unique keys -2224 Running queries -2226 Merge progress -2228 # documents indexed -2230 Total # documents -2232 Total # of queries -2234 Deferred for indexing -2236 Indexing Service Filter -2238 Total indexing speed (MB/hr) -2240 Binding time (msec) -2242 Indexing speed (MB/hr) -2244 Http Indexing Service -2246 Cache items -2248 % Cache hits -2250 Total cache accesses 1 -2252 % Cache misses -2254 Total cache accesses 2 -2256 Active queries -2258 Total queries -2260 Queries per minute -2262 Current requests queued -2264 Total requests rejected -2266 WMI Objects -2268 HiPerf Classes -2270 HiPerf Validity -2272 BatteryStatus -2274 ChargeRate -2276 DischargeRate -2278 RemainingCapacity -2280 Tag -2282 Voltage From 788c125c684ebe08f6418300a31fefcdd0966bb4 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:30:20 -0700 Subject: [PATCH 3/7] no longer using hpux dlpi --- src/os/hpux/dlpi.c | 284 --------------------------------------------- 1 file changed, 284 deletions(-) delete mode 100644 src/os/hpux/dlpi.c diff --git a/src/os/hpux/dlpi.c b/src/os/hpux/dlpi.c deleted file mode 100644 index a7732036..00000000 --- a/src/os/hpux/dlpi.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -/* - * talk to Data Link Provider Interface aka /dev/dlpi - * see: http://docs.hp.com/hpux/onlinedocs/B2355-90139/B2355-90139.html - */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#define DLBUF_SIZE 8192 - -#define ERRBUF_SIZE 1024 - -static int send_req(int fd, char *ptr, int len, char *what, char *ebuf) -{ - struct strbuf ctl; - int flags = 0; - - ctl.maxlen = 0; - ctl.len = len; - ctl.buf = ptr; - - if (putmsg(fd, &ctl, (struct strbuf *) NULL, flags) < 0) { - snprintf(ebuf, ERRBUF_SIZE, "send_req: putmsg \"%s\": %s", - what, strerror(errno)); - return -1; - } - - return 0; -} - -static int recv_ack(int fd, int size, const char *what, char *bufp, char *ebuf) -{ - union DL_primitives *dlp; - struct strbuf ctl; - int flags = 0; - - ctl.maxlen = DLBUF_SIZE; - ctl.len = 0; - ctl.buf = bufp; - - if (getmsg(fd, &ctl, (struct strbuf*)NULL, &flags) < 0) { - snprintf(ebuf, ERRBUF_SIZE, "recv_ack: %s getmsg: %s", - what, strerror(errno)); - return -1; - } - - dlp = (union DL_primitives *)ctl.buf; - switch (dlp->dl_primitive) { - case DL_INFO_ACK: - case DL_BIND_ACK: - case DL_OK_ACK: - case DL_HP_PPA_ACK: - case DL_HP_INFO_ACK: - case DL_GET_STATISTICS_ACK: - break; - - case DL_ERROR_ACK: - switch (dlp->error_ack.dl_errno) { - - case DL_SYSERR: - snprintf(ebuf, ERRBUF_SIZE, "recv_ack: %s: system error - %s", - what, strerror(dlp->error_ack.dl_unix_errno)); - break; - - default: - snprintf(ebuf, ERRBUF_SIZE, "recv_ack: %s: dl error - %d", - what, dlp->error_ack.dl_errno); - break; - } - return -1; - default: - snprintf(ebuf, ERRBUF_SIZE, - "recv_ack: %s: unexpected primitive ack %d", - what, dlp->dl_primitive); - return -1; - } - - if (ctl.len < size) { - snprintf(ebuf, ERRBUF_SIZE, - "recv_ack: %s: ack too small (%d < %d)", - what, ctl.len, size); - return -1; - } - - return ctl.len; -} - -static int dl_attach_req(int fd, uint32_t ppa, char *ebuf) -{ - dl_attach_req_t req; - - req.dl_primitive = DL_ATTACH_REQ; - req.dl_ppa = ppa; - - return send_req(fd, (char *)&req, sizeof(req), "attach", ebuf); -} - -static int dl_bind_req(int fd, uint32_t sap, char *ebuf) -{ - dl_bind_req_t req; - - memset((char *)&req, 0, sizeof(req)); - req.dl_primitive = DL_BIND_REQ; - - req.dl_max_conind = 1; - /* 22 == INSAP, see HP-UX DLPI Programmer's Guide */ - req.dl_sap = 22; - req.dl_service_mode = DL_HP_RAWDLS; - req.dl_service_mode = DL_CODLS; - - return send_req(fd, (char *)&req, sizeof(req), "bind", ebuf); -} - -static int dl_bind_ack(int fd, char *bufp, char *ebuf) -{ - return recv_ack(fd, DL_BIND_ACK_SIZE, "bind", bufp, ebuf); -} - -static int dl_ok_ack(int fd, const char *what, char *bufp, char *ebuf) -{ - return recv_ack(fd, DL_OK_ACK_SIZE, what, bufp, ebuf); -} - -static int dl_info_req(int fd, char *ebuf) -{ - dl_info_req_t req; - - req.dl_primitive = DL_INFO_REQ; - - return send_req(fd, (char *)&req, sizeof(req), "info", ebuf); -} - -static int dl_info_ack(int fd, char *bufp, char *ebuf) -{ - return recv_ack(fd, DL_INFO_ACK_SIZE, "info", bufp, ebuf); -} - -static int dl_hp_info_req(int fd, char *ebuf) -{ - dl_hp_info_req_t req; - - req.dl_primitive = DL_HP_INFO_REQ; - - return send_req(fd, (char *)&req, sizeof(req), "hpinfo", ebuf); -} - -static int dl_hp_info_ack(int fd, char *bufp, char *ebuf) -{ - return recv_ack(fd, DL_HP_INFO_ACK_SIZE, "hpinfo", bufp, ebuf); -} - -static int dl_stats_req(int fd, char *ebuf) -{ - dl_get_statistics_req_t req; - - req.dl_primitive = DL_GET_STATISTICS_REQ; - - return send_req(fd, (char *)&req, sizeof(req), "stats", ebuf); -} - -static int dl_stats_ack(int fd, char *bufp, char *ebuf) -{ - return recv_ack(fd, DL_GET_STATISTICS_ACK_SIZE, "stats", bufp, ebuf); -} - -static int dl_open(int ppa, char *ebuf) -{ - char *dev = "/dev/dlpi"; - int fd = -1; - dl_info_ack_t *infop; - uint32_t buf[DLBUF_SIZE]; - char dname[128]; - - if ((fd = open(dev, O_RDWR)) < 0) { - snprintf(ebuf, sizeof(ebuf), - "failed to open %s: %s", dev, strerror(errno)); - return -1; - } - - if (dl_info_req(fd, ebuf) < 0 || - dl_info_ack(fd, (char *)buf, ebuf) < 0) { - return -1; - } - - infop = &((union DL_primitives *)buf)->info_ack; - - if (infop->dl_provider_style == DL_STYLE2 && - (dl_attach_req(fd, ppa, ebuf) < 0 || - dl_ok_ack(fd, "attach", (char *)buf, ebuf) < 0)) - { - return -1; - } - - if (dl_bind_req(fd, 0, ebuf) < 0 || - dl_bind_ack(fd, (char *)buf, ebuf) < 0) - { - return -1; - } - - return fd; -} - -static int dl_get_hp_info(int fd, char *bufp, char *ebuf) -{ - dl_hp_info_ack_t *ip; - - if ((dl_hp_info_req(fd, ebuf) < 0) || - (dl_hp_info_ack(fd, bufp, ebuf) < 0)) { - return -1; - } - - ip = (dl_hp_info_ack_t *)bufp; - if (ip->dl_primitive != DL_HP_INFO_ACK) { - return -1; - } - - return 0; -} - -static int dl_get_stats(int fd, char *bufp, char *ebuf) -{ - dl_get_statistics_ack_t *ip; - - if ((dl_stats_req(fd, ebuf) < 0) || - (dl_stats_ack(fd, bufp, ebuf) < 0)) { - return -1; - } - - ip = (dl_get_statistics_ack_t *)bufp; - if (ip->dl_primitive != DL_GET_STATISTICS_ACK) { - return -1; - } - - return 0; -} - -int hpux_get_mib_ifentry(int ppa, mib_ifEntry *mib) -{ - int fd, status=0; - char ebuf[ERRBUF_SIZE]; - uint32_t buf[DLBUF_SIZE]; - - if ((fd = dl_open(ppa, ebuf)) < 0) { - return errno; - } - - if (dl_get_stats(fd, (char *)buf, ebuf) >= 0) { - dl_get_statistics_ack_t *st = (dl_get_statistics_ack_t *)buf; - memcpy(mib, (u_char *)buf + st->dl_stat_offset, sizeof(*mib)); - } - else { - status = errno; - } - - close(fd); - return status; -} From f272cb2b5dd332ae6d00994aadf56c5891d739d4 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:40:54 -0700 Subject: [PATCH 4/7] netware no longer supported --- bindings/java/build.xml | 9 - src/os/netware/Makefile | 72 ---- src/os/netware/netware_sigar.c | 719 --------------------------------- src/os/netware/sigar.def.in | 19 - src/os/netware/sigar_os.h | 26 -- 5 files changed, 845 deletions(-) delete mode 100644 src/os/netware/Makefile delete mode 100644 src/os/netware/netware_sigar.c delete mode 100644 src/os/netware/sigar.def.in delete mode 100644 src/os/netware/sigar_os.h diff --git a/bindings/java/build.xml b/bindings/java/build.xml index bc9bee12..789897e4 100644 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -156,15 +156,6 @@ value="${build}/src/sigar_version.c"/> - - - - - - diff --git a/src/os/netware/Makefile b/src/os/netware/Makefile deleted file mode 100644 index 43775c67..00000000 --- a/src/os/netware/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -NDKBASE = c:/novell -#SYS:/ drive mount -NDRIVE = g: - -NDK_ROOT = $(NDKBASE)/ndk -SDK_LIBC = $(NDK_ROOT)/libc -SDK_CLIB = $(NDK_ROOT)/clib - -JBINDINGS = ../../../bindings/java -JBUILD = $(JBINDINGS)/build -DEF_FILE = $(JBUILD)/sigar.def -JINCLUDES = -I$(NDRIVE)/JAVA/include -I$(NDRIVE)/JAVA/include/netware -INCLUDES = $(JINCLUDES) -I../../../include -I. -I$(JBUILD)/src -OBJDIR = $(JBUILD)/obj/x86-netware -LIBDIR = $(JBINDINGS)/sigar-bin/lib -SIGARLIB = $(LIBDIR)/sigar.nlm - -DB = NDEBUG -# DB = DEBUG - -ifeq ($(DB),NDEBUG) - OPT = -O2 -else - OPT = -g -endif - -CC = mwccnlm - -CFLAGS = -DNETWARE -D$(DB) -nostdinc $(OPT) -CFLAGS += -gccinc -inline off -opt nointrinsics -align 4 -inst mmx -proc 686 - -PRELUDE = $(SDK_LIBC)/imports/libcpre.o -LD = mwldnlm -LDFLAGS = -nostdlib $(PRELUDE) $(DEF_FILE) $(NW_OBJ) $(SIGAR_OBJ) $(JNI_OBJ) -o $(SIGARLIB) -type generic - -INCLUDES += \ --I$(SDK_LIBC)/include \ --I$(SDK_LIBC)/include/nks \ --I$(SDK_LIBC)/include/winsock \ --I$(SDK_CLIB)/include \ --I$(SDK_CLIB)/include/nlm - -CFLAGS += $(INCLUDES) - -NW_SRC = .\netware_sigar.c - -SIGAR_SRC = \ -..\..\sigar.c \ -..\..\sigar_cache.c \ -..\..\sigar_getline.c \ -..\..\sigar_fileinfo.c \ -..\..\sigar_util.c \ -..\..\sigar_win32ish.c \ - -JNI_SRC = $(JBINDINGS)\src\jni\javasigar.c - -NW_OBJ = $(NW_SRC:.c=.o) -SIGAR_OBJ = $(SIGAR_SRC:.c=.o) -JNI_OBJ = $(JNI_SRC:.c=.o) - -all: $(OBJDIR) $(SIGARLIB) - -clean: - -$(RM) -r $(OBJDIR) - -$(OBJDIR): - @mkdir $(OBJDIR) - -$(SIGARLIB): $(SIGAR_OBJ) $(NW_OBJ) $(JNI_OBJ) $(DEF_FILE) - @echo Linking $@ - @-$(RM) $@ - @$(LD) $(LDFLAGS) diff --git a/src/os/netware/netware_sigar.c b/src/os/netware/netware_sigar.c deleted file mode 100644 index 8095bce1..00000000 --- a/src/os/netware/netware_sigar.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -#define WIN32_LEAN_AND_MEAN - -#include "sigar.h" -#include "sigar_private.h" -#include "sigar_os.h" -#include "sigar_util.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#define _STRUCT_TM -#include -#include -#include -/* - * http://developer.novell.com/research/appnotes/2003/may/05/a0305058.htm - */ -int _NonAppStart(void *NLMHandle, - void *errorScreen, - const char *cmdLine, - const char *loadDirPath, - size_t uninitializedDataLength, - void *NLMFileHandle, - int (*readRoutineP)(int conn, - void *fileHandle, - size_t offset, - size_t nbytes, - size_t *bytesRead, - void *buffer), - size_t customDataOffset, - size_t customDataSize, - int messageCount, - const char **messages) -{ - -#pragma unused(cmdLine) -#pragma unused(loadDirPath) -#pragma unused(uninitializedDataLength) -#pragma unused(NLMFileHandle) -#pragma unused(readRoutineP) -#pragma unused(customDataOffset) -#pragma unused(customDataSize) -#pragma unused(messageCount) -#pragma unused(messages) - - WSADATA wsaData; - - NWCallsInit(NULL, NULL); - - return WSAStartup((WORD)MAKEWORD(2, 0), &wsaData); -} - -void _NonAppStop(void) -{ - NWCallsTerm(NULL); - WSACleanup(); -} - -int _NonAppCheckUnload(void) -{ - return 0; -} - -int sigar_os_open(sigar_t **sigar) -{ - *sigar = malloc(sizeof(**sigar)); - - return SIGAR_OK; -} - -int sigar_os_close(sigar_t *sigar) -{ - free(sigar); - return SIGAR_OK; -} - -char *sigar_os_error_string(sigar_t *sigar, int err) -{ - return NULL; -} - -int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) -{ - struct memory_info info; - if (netware_mem_info(&info) != 0) { - return errno; - } - mem->total = info.TotalKnownSystemMemoryUnder4Gb; - mem->used = info.TotalWorkMemory; - mem->free = mem->total - mem->used; - mem->actual_free = mem->free; - mem->actual_used = mem->used; - - sigar_mem_calc_ram(sigar, mem); - - return SIGAR_OK; -} - -int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap) -{ - struct vmemory_info info; - - if (netware_vmem_info(&info) != 0) { - return errno; - } - - swap->used = info.SwapPageCount * PAGESIZE; - swap->free = info.SwapFreeCount * PAGESIZE; - swap->total = swap->used + swap->free; - swap->page_in = swap->page_out = -1; - - return SIGAR_OK; -} - -int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) -{ - cpu->user = -1; - cpu->nice = -1; - cpu->sys = -1; - cpu->idle = -1; - cpu->wait = -1; - - cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle; - - return SIGAR_OK; -} - -int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_uptime_get(sigar_t *sigar, - sigar_uptime_t *uptime) -{ - LONG seconds, tenths; - - TicksToSeconds(GetCurrentTicks(), &seconds, &tenths); - uptime->uptime = seconds; - - return SIGAR_OK; -} - -int sigar_loadavg_get(sigar_t *sigar, - sigar_loadavg_t *loadavg) -{ - loadavg->loadavg[0] = -1; - loadavg->loadavg[1] = -1; - loadavg->loadavg[2] = -1; - - return SIGAR_OK; -} - -int sigar_proc_list_get(sigar_t *sigar, - sigar_proc_list_t *proclist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_mem_t *procmem) -{ - procmem->size = -1; - procmem->vsize = -1; - procmem->share = -1; - procmem->rss = -1; - procmem->resident = -1; - procmem->page_faults = -1; - procmem->minor_faults = -1; - procmem->major_faults = -1; - - return SIGAR_OK; -} - -int sigar_proc_cred_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_cred_t *proccred) -{ - proccred->uid = -1; - proccred->gid = -1; - proccred->euid = -1; - proccred->egid = -1; - - return SIGAR_OK; -} - -int sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_time_t *proctime) -{ - proctime->start_time = -1; - proctime->user = -1; - proctime->sys = -1; - proctime->total = proctime->user + proctime->sys; - - return SIGAR_OK; -} - -int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_state_t *procstate) -{ - SIGAR_SSTRCPY(procstate->name, "java"); - procstate->ppid = -1; - procstate->priority = -1; - procstate->nice = -1; - procstate->tty = -1; - procstate->state = 'R'; - procstate->threads = -1; - procstate->processor = -1; - - return SIGAR_OK; -} - -int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_args_t *procargs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_env_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_env_t *procenv) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_fd_t *procfd) -{ - procfd->total = -1; - return SIGAR_OK; -} - -int sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_exe_t *procexe) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_modules_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_modules_t *procmods) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_thread_cpu_get(sigar_t *sigar, - sigar_uint64_t id, - sigar_thread_cpu_t *cpu) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_fs_type_get(sigar_file_system_t *fsp) -{ - fsp->type = SIGAR_FSTYPE_UNKNOWN; - - return SIGAR_OK; -} - -int sigar_file_system_list_get(sigar_t *sigar, - sigar_file_system_list_t *fslist) -{ - struct volume_info info; - int num = 0; - - sigar_file_system_list_create(fslist); - - while (netware_vol_info(&info, &num) == 0) { - sigar_file_system_t *fsp; - int len; - char *type = NULL; - - SIGAR_FILE_SYSTEM_LIST_GROW(fslist); - - fsp = &fslist->data[fslist->number++]; - SIGAR_SSTRCPY(fsp->dev_name, info.name); - SIGAR_SSTRCPY(fsp->dir_name, info.name); - len = strlen(info.name); - fsp->dir_name[len] = ':'; - fsp->dir_name[len+1] = '/'; - fsp->dir_name[len+2] = '\0'; - - fsp->type = SIGAR_FSTYPE_LOCAL_DISK; - type = "nss"; - - sigar_fs_type_get(fsp); - if (!type) { - type = fsp->type_name; - } - - SIGAR_SSTRCPY(fsp->sys_type_name, type); - fsp->options[0] = '\0'; /*XXX*/ - } - - return SIGAR_OK; -} - -int sigar_disk_usage_get(sigar_t *sigar, const char *name, - sigar_disk_usage_t *usage) -{ - return SIGAR_ENOTIMPL; -} - -#define SIGAR_FS_BLOCKS_TO_BYTES(buf, f) \ - ((buf.f * (buf.f_bsize / 512)) >> 1) - -int sigar_file_system_usage_get(sigar_t *sigar, - const char *dirname, - sigar_file_system_usage_t *fsusage) -{ - struct statfs buf; - - if (statfs(dirname, &buf) != 0) { - return errno; - } - - fsusage->total = SIGAR_FS_BLOCKS_TO_BYTES(buf, f_blocks); - fsusage->free = SIGAR_FS_BLOCKS_TO_BYTES(buf, f_bfree); - fsusage->avail = fsusage->free; - fsusage->used = fsusage->total - fsusage->free; - fsusage->files = buf.f_files; - fsusage->free_files = buf.f_ffree; - fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage); - - SIGAR_DISK_STATS_INIT(&fsusage->disk); - - return SIGAR_OK; -} - -int sigar_cpu_info_list_get(sigar_t *sigar, - sigar_cpu_info_list_t *cpu_infos) -{ - struct cpu_info cpu; - int num = 0; - - sigar_cpu_info_list_create(cpu_infos); - - while (netware_cpu_info(&cpu, &num) == 0) { - sigar_cpu_info_t *info; - - SIGAR_CPU_INFO_LIST_GROW(cpu_infos); - - info = &cpu_infos->data[cpu_infos->number++]; - - SIGAR_SSTRCPY(info->vendor, "vendor"); - SIGAR_SSTRCPY(info->model, "model"); - info->mhz = cpu.Speed; - info->cache_size = cpu.L2CacheSize; - } - - return SIGAR_OK; -} - -int sigar_net_route_list_get(sigar_t *sigar, - sigar_net_route_list_t *routelist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, - sigar_net_interface_stat_t *ifstat) -{ - LONG board = 1; /* XXX derive from name */ - LONG block = 0; - BYTE buffer[SS_DEFAULT_BUFFER_SIZE]; - WORD len = sizeof(buffer); - CommonLANStructure *info; - - if (SSGetLANCommonCounters(board, block, buffer, len) != 0) { - return ENOENT; - } - - info = &((GetLANCommonCountersStructure *)buffer)->info; - - ifstat->rx_bytes = info->TotalTxOKByteCountHigh; - ifstat->rx_packets = info->TotalRxPacketCount; - ifstat->rx_errors = info->PacketRxMiscErrorCount; - ifstat->rx_dropped = -1; - ifstat->rx_overruns = info->PacketRxTooBigCount; - ifstat->rx_frame = -1; - - ifstat->tx_bytes = info->TotalTxOKByteCountHigh; - ifstat->tx_packets = info->TotalTxPacketCount; - ifstat->tx_errors = info->PacketTxMiscErrorCount; - ifstat->tx_dropped = info->RetryTxCount; - ifstat->tx_overruns = info->PacketTxTooBigCount; - ifstat->tx_collisions = -1; - ifstat->tx_carrier = -1; - - ifstat->speed = SIGAR_FIELD_NOTIMPL; - - return SIGAR_OK; -} - -int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_net_info_get(sigar_t *sigar, - sigar_net_info_t *netinfo) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_port_get(sigar_t *sigar, int protocol, - unsigned long port, sigar_pid_t *pid) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_ping(char *host) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_sys_info_get(sigar_t *sigar, - sigar_sys_info_t *sysinfo) -{ - SIGAR_SSTRCPY(sysinfo->vendor, "Novell"); - - return SIGAR_OK; -} - -int sigar_get_iftype(const char *name, int *type, int *inst) -{ - if (strnEQ(name, "eth", IFTYPE_ETH)) { - *type = IFTYPE_ETH; - } - else if (strnEQ(name, "lo", IFTYPE_LO)) { - *type = IFTYPE_LO; - } - else { - return EINVAL; - } - - if (isdigit(*(name + *type))) { - *inst = atoi(name + *type); - } - else { - return EINVAL; - } - - return SIGAR_OK; -} - -static void hwaddr_lookup(sigar_t *sigar, - sigar_net_interface_config_t *ifconfig, - int num) -{ - uint8_t addr[SIGAR_IFHWADDRLEN]; - - if (netware_net_macaddr(num+1, addr) == 0) { - sigar_net_address_mac_set(ifconfig->hwaddr, - addr, - sizeof(addr)); - } - else { - sigar_hwaddr_set_null(ifconfig); - } -} - -static int sigar_ioctl_iflist(sigar_t *sigar, - SOCKET sock, - DWORD *bytes) -{ - return WSAIoctl(sock, - SIO_GET_INTERFACE_LIST, - NULL, - 0, - (void *)sigar->ifconf_buf, - sigar->ifconf_len, - bytes, - NULL, - NULL); -} - -static int get_iflist(sigar_t *sigar, DWORD *bytes) -{ - SOCKET sock = INVALID_SOCKET; - int status, rc, limit; - - sock = socket(AF_INET, SOCK_DGRAM, 0); - - if (sock == INVALID_SOCKET) { - return WSAGetLastError(); - } - - if (sigar->ifconf_len == 0) { - sigar->ifconf_len = 8192; - sigar->ifconf_buf = malloc(sigar->ifconf_len); - } - - /* - * XXX We can't tell ahead of time what buffer size is required - * limit just incase. - */ - for (limit=0; limit<100; limit++) { - rc = sigar_ioctl_iflist(sigar, sock, bytes); - if (rc && (WSAGetLastError() == WSAEFAULT)) { - sigar->ifconf_len += (sizeof(INTERFACE_INFO) * 16); - sigar->ifconf_buf = malloc(sigar->ifconf_len); - } - } - - status = rc ? WSAGetLastError() : SIGAR_OK; - - closesocket(sock); - - return status; -} - -SIGAR_DECLARE(int) -sigar_net_interface_config_get(sigar_t *sigar, - const char *name, - sigar_net_interface_config_t *ifconfig) -{ - DWORD i, num, bytes; - DWORD lo=0, eth=0; - int status, type, inst; - INTERFACE_INFO *if_info = NULL; - u_long flags; - - if (!name) { - return sigar_net_interface_config_primary_get(sigar, ifconfig); - } - - /* win32 lacks socket ioctls to query given interface. - * so we loop through the list to find our made up ifname. - */ - status = get_iflist(sigar, &bytes); - if (status != SIGAR_OK) { - return status; - } - - num = bytes / sizeof(INTERFACE_INFO); - - if ((status = sigar_get_iftype(name, &type, &inst)) != SIGAR_OK) { - return status; - } - - for (i=0; iifconf_buf) + i; - - if (if_info->iiFlags & IFF_LOOPBACK) { - if ((type == IFTYPE_LO) && (inst == lo)) { - break; - } - ++lo; - } - else { - if ((type == IFTYPE_ETH) && (inst == eth)) { - break; - } - ++eth; - } - - if_info = NULL; - } - - if (!if_info) { - return ENOENT; - } - - SIGAR_ZERO(ifconfig); - - SIGAR_SSTRCPY(ifconfig->name, name); - -#define if_s_addr(a) \ - ((struct sockaddr_in *)&a)->sin_addr.s_addr - - sigar_net_address_set(ifconfig->address, - if_s_addr(if_info->iiAddress)); - sigar_net_address_set(ifconfig->broadcast, - if_s_addr(if_info->iiBroadcastAddress)); - sigar_net_address_set(ifconfig->netmask, - if_s_addr(if_info->iiNetmask)); - - flags = if_info->iiFlags; - - if (flags & IFF_UP) { - ifconfig->flags |= SIGAR_IFF_UP|SIGAR_IFF_RUNNING; - } - if (flags & IFF_BROADCAST) { - ifconfig->flags |= SIGAR_IFF_BROADCAST; - } - if (flags & IFF_LOOPBACK) { - ifconfig->flags |= SIGAR_IFF_LOOPBACK; - sigar_net_address_set(ifconfig->destination, - ifconfig->address.addr.in); - sigar_net_address_set(ifconfig->broadcast, 0); - SIGAR_SSTRCPY(ifconfig->type, - SIGAR_NIC_LOOPBACK); - } - else { - SIGAR_SSTRCPY(ifconfig->type, - SIGAR_NIC_ETHERNET); - } - - /* should be overridden w/ better description - * using MIB_IFROW.bDescr when hwaddr is lookedup - */ - SIGAR_SSTRCPY(ifconfig->description, - ifconfig->name); - - hwaddr_lookup(sigar, ifconfig, i); - - if (flags & IFF_POINTTOPOINT) { - ifconfig->flags |= SIGAR_IFF_POINTOPOINT; - } - if (flags & IFF_MULTICAST) { - ifconfig->flags |= SIGAR_IFF_MULTICAST; - } - - return SIGAR_OK; -} - -/* - * win32 interface list does not include a name. - * and the name from GetIfList() is the name of card - * including vendor name, etc. so we use 'eth' for ethernet - * interfaces and 'lo' for loopback. - */ - -#define ETH "eth" -#define LO "lo" - -SIGAR_DECLARE(int) -sigar_net_interface_list_get(sigar_t *sigar, - sigar_net_interface_list_t *iflist) -{ - char eth[56], lo[56]; - int ethcnt=0, locnt=0; - DWORD i, num, bytes; - int status; - - status = get_iflist(sigar, &bytes); - if (status != SIGAR_OK) { - return status; - } - - num = bytes / sizeof(INTERFACE_INFO); - - iflist->number = 0; - iflist->size = num; - iflist->data = - malloc(sizeof(*(iflist->data)) * iflist->size); - - for (i=0; iifconf_buf) + i; - char *name; - - if (if_info->iiFlags & IFF_LOOPBACK) { - sprintf(lo, LO "%d", locnt++); - name = strdup(lo); - } - else { - /* XXX: assuming ethernet here */ - sprintf(eth, ETH "%d", ethcnt++); - name = strdup(eth); - } - - iflist->data[iflist->number++] = name; - } - - return SIGAR_OK; -} - -SIGAR_DECLARE(int) -sigar_tcp_get(sigar_t *sigar, - sigar_tcp_t *tcp) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v2_get(sigar_t *sigar, - sigar_nfs_client_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v2_get(sigar_t *sigar, - sigar_nfs_server_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v3_get(sigar_t *sigar, - sigar_nfs_client_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v3_get(sigar_t *sigar, - sigar_nfs_server_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} diff --git a/src/os/netware/sigar.def.in b/src/os/netware/sigar.def.in deleted file mode 100644 index 53bd17fa..00000000 --- a/src/os/netware/sigar.def.in +++ /dev/null @@ -1,19 +0,0 @@ -copyright "Copyright @@COPYRIGHT_YEAR@@ Hyperic, LLC" -description Sigar -version @@VERSION_MAJOR@@,@@VERSION_MINOR@@,@@VERSION_MAINT@@ -stack 8192 -screenname DEFAULT -threadname sigar -autounload -pseudopreemption -start _LibCPrelude -exit _LibCPostlude -check _LibCCheckUnload -import @c:/novell/ndk/libc/imports/libc.imp -import @c:/novell/ndk/libc/imports/netware.imp -import @c:/novell/ndk/libc/imports/ws2nlm.imp -import @c:/novell/ndk/clib/imports/clib.imp -import @c:/novell/ndk/clib/imports/calnlm32.imp -module libc -export @../../../bindings/java/build/src/javasigar_generated.def - diff --git a/src/os/netware/sigar_os.h b/src/os/netware/sigar_os.h deleted file mode 100644 index 3b385cb3..00000000 --- a/src/os/netware/sigar_os.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -#ifndef SIGAR_OS_H -#define SIGAR_OS_H - -struct sigar_t { - SIGAR_T_BASE; -}; - -#endif /* SIGAR_OS_H */ From 5d79c359d4f057bec2712c10498db613210f3bae Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:46:19 -0700 Subject: [PATCH 5/7] netware no longer supported --- bindings/SigarWrapper.pm | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/bindings/SigarWrapper.pm b/bindings/SigarWrapper.pm index 205185b9..d60bd22b 100644 --- a/bindings/SigarWrapper.pm +++ b/bindings/SigarWrapper.pm @@ -2777,39 +2777,5 @@ sub finish { $self->SUPER::finish; } -#XXX not currently supporting netware -package SigarWrapper::Netware; - -use vars qw(@ISA); -@ISA = qw(SigarWrapper); - -sub start { - my $self = shift; - $self->SUPER::start; - $self->{dfh} = $self->create('javasigar_generated.def'); -} - -sub finish { - my $self = shift; - my $fh = $self->{dfh}; - for my $func (@{ $self->{nativefunc} }) { - #$fh->println($nativefunc) if $impl; - } - my $jsigar = "../../src/jni/javasigar.c"; - my(%alias) = (x => 'Sigar'); - open JSIGAR, $jsigar or die "open $jsigar: $!"; - while () { - next unless /SIGAR_JNI([a-z]?)\(([A-Za-z_]+)\)/; - my $class = ""; - if ($1) { - $class = $alias{$1} . "_"; - } - $fh->println("Java_org_hyperic_sigar_$class$2"); - } - close JSIGAR; - - $self->SUPER::finish; -} - 1; __END__ From 56e03d7243da766c1b18fa247909a28d16fbb37b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:48:22 -0700 Subject: [PATCH 6/7] osf1 no longer supported --- src/os/osf1/osf1_sigar.c | 593 --------------------------------------- src/os/osf1/sigar_os.h | 42 --- 2 files changed, 635 deletions(-) delete mode 100644 src/os/osf1/osf1_sigar.c delete mode 100644 src/os/osf1/sigar_os.h diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c deleted file mode 100644 index 04fb3e92..00000000 --- a/src/os/osf1/osf1_sigar.c +++ /dev/null @@ -1,593 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -#include "sigar.h" -#include "sigar_private.h" -#include "sigar_os.h" -#include "sigar_util.h" - -#include -#include -#include - -#include -#include -#include - -int sigar_os_open(sigar_t **sigar) -{ - *sigar = malloc(sizeof(**sigar)); - - (*sigar)->pagesize = getpagesize(); - (*sigar)->boot_time = 0; - (*sigar)->mhz = 0; - (*sigar)->nproc = -1; - - return SIGAR_OK; -} - -int sigar_os_close(sigar_t *sigar) -{ - free(sigar); - return SIGAR_OK; -} - -char *sigar_os_error_string(sigar_t *sigar, int err) -{ - return NULL; -} - -int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) -{ - vm_statistics_data_t vmstats; - - vm_statistics(task_self(), &vmstats); - - mem->free = vmstats.free_count * vmstats.pagesize; - mem->used = vmstats.active_count * vmstats.pagesize; - - mem->total = - mem->free + mem->used + - ((vmstats.inactive_count + vmstats.wire_count) * vmstats.pagesize); - - mem->actual_free = mem->free; - mem->actual_used = mem->used; - - sigar_mem_calc_ram(sigar, mem); - - return SIGAR_OK; -} - -int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap) -{ - struct tbl_swapinfo info; - - table(TBL_SWAPINFO, -1, &info, 1, sizeof(info)); - - swap->total = info.size; - swap->free = info.free; - swap->total *= sigar->pagesize; - swap->free *= sigar->pagesize; - - swap->used = swap->total - swap->free; - - swap->page_in = swap->page_out = -1; - - return SIGAR_OK; -} - -int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) -{ - struct tbl_sysinfo sysinfo; - - if (table(TBL_SYSINFO, 0, &sysinfo, 1, sizeof(sysinfo)) != 1) { - return errno; - } - - cpu->user = sysinfo.si_user; - cpu->nice = sysinfo.si_nice; - cpu->sys = sysinfo.si_sys; - cpu->idle = sysinfo.si_idle; - cpu->wait = 0; /*N/A?*/ - cpu->irq = 0; /*N/A*/ - cpu->soft_irq = 0; /*N/A*/ - cpu->stolen = 0; /*N/A*/ - cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->wait; - - return SIGAR_OK; -} - -int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist) -{ - sigar_cpu_t *cpu; - - sigar_cpu_list_create(cpulist); - - /* XXX multi cpu */ - cpu = &cpulist->data[cpulist->number++]; - - return sigar_cpu_get(sigar, cpu); -} - -int sigar_uptime_get(sigar_t *sigar, - sigar_uptime_t *uptime) -{ - if (sigar->boot_time == 0) { - struct tbl_sysinfo sysinfo; - - if (table(TBL_SYSINFO, 0, &sysinfo, 1, sizeof(sysinfo)) != 1) { - return errno; - } - - sigar->boot_time = sysinfo.si_boottime; - } - - uptime->uptime = time(NULL) - sigar->boot_time; - - return SIGAR_OK; -} - -int sigar_loadavg_get(sigar_t *sigar, - sigar_loadavg_t *loadavg) -{ - int i; - struct tbl_loadavg avg; - - if (table(TBL_LOADAVG, 0, &avg, 1, sizeof(avg)) < 0) { - return errno; - } - - if (avg.tl_lscale) { - for (i=0; i<3; i++) { - loadavg->loadavg[i] = - ((double)avg.tl_avenrun.l[i] / - (double)avg.tl_lscale); - } - } - else { - for (i=0; i<3; i++) { - loadavg->loadavg[i] = avg.tl_avenrun.d[i]; - } - } - - return SIGAR_OK; -} - -#define PROC_ELTS 16 - -int sigar_os_proc_list_get(sigar_t *sigar, - sigar_proc_list_t *proclist) -{ - struct tbl_procinfo procinfo[PROC_ELTS]; - int offset; - - if (sigar->nproc == -1) { - /* this number will not change while we are running */ - sigar->nproc = table(TBL_PROCINFO, 0, NULL, INT_MAX, 0); - } - - for (offset=0; offsetnproc; offset+=PROC_ELTS) { - int i; - int elts = table(TBL_PROCINFO, offset, &procinfo, - PROC_ELTS, sizeof(procinfo[0])); - - for (i=0; ipi_status == PI_EMPTY) { - continue; - } - - SIGAR_PROC_LIST_GROW(proclist); - - proclist->data[proclist->number++] = info->pi_pid; - } - } - - return SIGAR_OK; -} - -int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_mem_t *procmem) -{ - task_t self; - task_basic_info_data_t taskinfo; - struct user s_user; - int type = TASK_BASIC_INFO_COUNT; - int status; - - status = task_by_unix_pid(task_self(), pid, &self); - - if (status != KERN_SUCCESS) { - return errno; - } - - status = task_info(self, TASK_BASIC_INFO, - (task_info_t)&taskinfo, &type); - - if (status != KERN_SUCCESS) { - return errno; - } - - procmem->resident = taskinfo.resident_size; - procmem->size = taskinfo.virtual_size; - - status = table(TBL_UAREA, pid, &s_user, 1, sizeof(s_user)); - - if (status != 1) { - procmem->share = SIGAR_FIELD_NOTIMPL; - return SIGAR_OK; - } - - procmem->share = s_user.u_ru.ru_ixrss; - - procmem->page_faults = SIGAR_FIELD_NOTIMPL; - procmem->minor_faults = SIGAR_FIELD_NOTIMPL; - procmem->major_faults = SIGAR_FIELD_NOTIMPL; - - return SIGAR_OK; -} - -int sigar_proc_cred_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_cred_t *proccred) -{ - proccred->uid = SIGAR_FIELD_NOTIMPL; - proccred->gid = SIGAR_FIELD_NOTIMPL; - proccred->euid = SIGAR_FIELD_NOTIMPL; - proccred->egid = SIGAR_FIELD_NOTIMPL; - - return SIGAR_OK; -} - -int sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_time_t *proctime) -{ - struct user s_user; - int status; - - status = table(TBL_UAREA, pid, &s_user, 1, sizeof(s_user)); - - if (status != 1) { - return errno; - } - - proctime->user = s_user.u_ru.ru_utime.tv_sec; - proctime->sys = s_user.u_ru.ru_stime.tv_sec; - proctime->total = proctime->user + proctime->sys; - proctime->start_time = s_user.u_start.tv_sec; - - return SIGAR_OK; -} - -int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_state_t *procstate) -{ - struct tbl_procinfo info; - int status; - - status = table(TBL_PROCINFO, pid, &info, 1, sizeof(info)); - - if (status != 1) { - return errno; - } - - SIGAR_SSTRCPY(procstate->name, info.pi_comm); - procstate->ppid = info.pi_ppid; - procstate->priority = SIGAR_FIELD_NOTIMPL; - procstate->nice = SIGAR_FIELD_NOTIMPL; - procstate->tty = info.pi_ttyd; - procstate->threads = SIGAR_FIELD_NOTIMPL; - procstate->processor = SIGAR_FIELD_NOTIMPL; - - switch (info.pi_status) { - case PI_ACTIVE: - procstate->state = 'R'; - break; - case PI_ZOMBIE: - procstate->state = 'Z'; - break; - default: - procstate->state = 'S'; - break; - } - - return SIGAR_OK; -} - -int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_args_t *procargs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_env_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_env_t *procenv) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_fd_t *procfd) -{ - procfd->total = SIGAR_FIELD_NOTIMPL; - return SIGAR_OK; -} - -int sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_exe_t *procexe) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_modules_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_modules_t *procmods) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_thread_cpu_get(sigar_t *sigar, - sigar_uint64_t id, - sigar_thread_cpu_t *cpu) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_fs_type_get(sigar_file_system_t *fsp) -{ - return fsp->type; -} - -static int sigar_fsstat(struct statfs **fs, int *num) -{ - int size; - - if ((*num = getfsstat(NULL, 0, MNT_WAIT)) < 0) { - return errno; - } - - size = ((*num)+1) * sizeof(struct statfs); - - *fs = malloc(size); - - if ((*num = getfsstat(*fs, size, MNT_WAIT)) < 0) { - free(fs); - return errno; - } - - return SIGAR_OK; -} - -int sigar_file_system_list_get(sigar_t *sigar, - sigar_file_system_list_t *fslist) -{ - int i, num, status; - struct statfs *fs; - - if ((status = sigar_fsstat(&fs, &num)) != SIGAR_OK) { - return status; - } - - sigar_file_system_list_create(fslist); - - for (i=0; idata[fslist->number++]; - - SIGAR_SSTRCPY(fsp->dir_name, fs[i].f_mntonname); - SIGAR_SSTRCPY(fsp->dev_name, fs[i].f_mntfromname); - SIGAR_SSTRCPY(fsp->sys_type_name, mnt_names[fs[i].f_type]); - fsp->options[0] = '\0'; /*XXX*/ - - switch (fs[i].f_type) { - case MOUNT_UFS: - typename = "ufs"; - fsp->type = SIGAR_FSTYPE_LOCAL_DISK; - break; - case MOUNT_MFS: - case MOUNT_MSFS: - typename = "advfs"; - fsp->type = SIGAR_FSTYPE_LOCAL_DISK; - break; - case MOUNT_FDFS: - typename = "fdfs"; - fsp->type = SIGAR_FSTYPE_LOCAL_DISK; - break; - case MOUNT_DVDFS: - case MOUNT_CDFS: - fsp->type = SIGAR_FSTYPE_CDROM; - break; - case MOUNT_DFS: /* DCE */ - typename = "dfs"; - fsp->type = SIGAR_FSTYPE_NETWORK; - break; - case MOUNT_EFS: /* DCE */ - typename = "efs"; - fsp->type = SIGAR_FSTYPE_NETWORK; - break; - case MOUNT_NFS: - case MOUNT_NFS3: - typename = "nfs"; - fsp->type = SIGAR_FSTYPE_NETWORK; - break; - case MOUNT_CSPEC: - case MOUNT_CFS: - typename = "cfs"; - fsp->type = SIGAR_FSTYPE_NETWORK; - break; - case MOUNT_NONE: - case MOUNT_PC: - case MOUNT_S5FS: - case MOUNT_PROCFS: - case MOUNT_FFM: - case MOUNT_ADDON: - case MOUNT_AUTOFS: - default: - break; - } - - /* we set fsp->type, just looking up sigar.c:fstype_names[type] */ - sigar_fs_type_get(fsp); - - if (typename == NULL) { - typename = fsp->type_name; - } - } - - free(fs); - - return SIGAR_OK; -} - -int sigar_disk_usage_get(sigar_t *sigar, const char *name, - sigar_disk_usage_t *usage) -{ - return SIGAR_ENOTIMPL; -} - -#define SIGAR_FS_BLOCKS_TO_BYTES(buf, f) \ - (((sigar_uint64_t)buf.f * (buf.f_bsize / 512)) >> 1) - -int sigar_file_system_usage_get(sigar_t *sigar, - const char *dirname, - sigar_file_system_usage_t *fsusage) -{ - struct statfs buf; - - if (statfs((char *)dirname, &buf) != 0) { - return errno; - } - - fsusage->total = SIGAR_FS_BLOCKS_TO_BYTES(buf, f_blocks); - fsusage->free = SIGAR_FS_BLOCKS_TO_BYTES(buf, f_bfree); - fsusage->avail = SIGAR_FS_BLOCKS_TO_BYTES(buf, f_bavail); - fsusage->used = fsusage->total - fsusage->free; - fsusage->files = buf.f_files; - fsusage->free_files = buf.f_ffree; - fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage); - - SIGAR_DISK_STATS_INIT(&fsusage->disk) - - return SIGAR_OK; -} - -int sigar_cpu_info_list_get(sigar_t *sigar, - sigar_cpu_info_list_t *cpu_infos) -{ - sigar_cpu_info_t *info; - - if (sigar->mhz == 0) { - struct tbl_sysinfo sysinfo; - - if (table(TBL_SYSINFO, 0, &sysinfo, 1, sizeof(sysinfo)) != 1) { - return errno; - } - - sigar->mhz = sysinfo.si_hz; - } - - sigar_cpu_info_list_create(cpu_infos); - - info = &cpu_infos->data[cpu_infos->number++]; - - SIGAR_SSTRCPY(info->vendor, "DEC"); - SIGAR_SSTRCPY(info->model, "alpha"); - info->mhz = sigar->mhz; - info->cache_size = SIGAR_FIELD_NOTIMPL; - - return SIGAR_OK; -} - -int sigar_net_route_list_get(sigar_t *sigar, - sigar_net_route_list_t *routelist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, - sigar_net_interface_stat_t *ifstat) -{ - ifstat->rx_bytes = SIGAR_FIELD_NOTIMPL; - ifstat->rx_packets = SIGAR_FIELD_NOTIMPL; - ifstat->rx_errors = SIGAR_FIELD_NOTIMPL; - ifstat->rx_dropped = SIGAR_FIELD_NOTIMPL; - ifstat->rx_overruns = SIGAR_FIELD_NOTIMPL; - ifstat->rx_frame = SIGAR_FIELD_NOTIMPL; - - ifstat->tx_bytes = SIGAR_FIELD_NOTIMPL; - ifstat->tx_packets = SIGAR_FIELD_NOTIMPL; - ifstat->tx_errors = SIGAR_FIELD_NOTIMPL; - ifstat->tx_dropped = SIGAR_FIELD_NOTIMPL; - ifstat->tx_overruns = SIGAR_FIELD_NOTIMPL; - ifstat->tx_collisions = SIGAR_FIELD_NOTIMPL; - ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; - - ifstat->speed = SIGAR_FIELD_NOTIMPL; - - return SIGAR_OK; -} - -int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) -{ - return SIGAR_ENOTIMPL; -} - -SIGAR_DECLARE(int) -sigar_tcp_get(sigar_t *sigar, - sigar_tcp_t *tcp) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v2_get(sigar_t *sigar, - sigar_nfs_client_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v2_get(sigar_t *sigar, - sigar_nfs_server_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v3_get(sigar_t *sigar, - sigar_nfs_client_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v3_get(sigar_t *sigar, - sigar_nfs_server_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_port_get(sigar_t *sigar, int protocol, - unsigned long port, sigar_pid_t *pid) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_sys_info_get(sigar_t *sigar, - sigar_sys_info_t *sysinfo) -{ - return SIGAR_OK; -} diff --git a/src/os/osf1/sigar_os.h b/src/os/osf1/sigar_os.h deleted file mode 100644 index 6814e8a9..00000000 --- a/src/os/osf1/sigar_os.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -#ifndef SIGAR_OS_H -#define SIGAR_OS_H - -#include -/* "i will *punch* you in the *face*" --will ferrell */ -#undef idle -#undef usr -#undef sys - -#include -#include - -#include -#include -#include - -struct sigar_t { - SIGAR_T_BASE; - int pagesize; - int mhz; - int nproc; -}; - -#endif /* SIGAR_OS_H */ From 277b80791c19785311f42b318cf8d49513ceb383 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Apr 2010 13:49:44 -0700 Subject: [PATCH 7/7] mv stub to sigar-stuff --- src/os/stub/sigar_os.h | 8 -- src/os/stub/stub_sigar.c | 303 --------------------------------------- 2 files changed, 311 deletions(-) delete mode 100644 src/os/stub/sigar_os.h delete mode 100644 src/os/stub/stub_sigar.c diff --git a/src/os/stub/sigar_os.h b/src/os/stub/sigar_os.h deleted file mode 100644 index 068fc3c6..00000000 --- a/src/os/stub/sigar_os.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SIGAR_OS_H -#define SIGAR_OS_H - -struct sigar_t { - SIGAR_T_BASE; -}; - -#endif /* SIGAR_OS_H */ diff --git a/src/os/stub/stub_sigar.c b/src/os/stub/stub_sigar.c deleted file mode 100644 index 354fb08a..00000000 --- a/src/os/stub/stub_sigar.c +++ /dev/null @@ -1,303 +0,0 @@ -#include "sigar.h" -#include "sigar_private.h" -#include "sigar_os.h" -#include "sigar_util.h" - -int sigar_os_open(sigar_t **sigar) -{ - *sigar = malloc(sizeof(**sigar)); - - return SIGAR_OK; -} - -int sigar_os_close(sigar_t *sigar) -{ - free(sigar); - return SIGAR_OK; -} - -char *sigar_os_error_string(sigar_t *sigar, int err) -{ - return NULL; -} - -int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) -{ - mem->total = -1; - mem->ram = -1; - mem->used = -1; - mem->free = -1; - mem->actual_free = mem->free; - mem->actual_used = mem->used; - return SIGAR_OK; -} - -int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap) -{ - swap->total = -1; - swap->used = -1; - swap->free = -1; - swap->page_in = -1; - swap->page_out = -1; - - return SIGAR_OK; -} - -int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) -{ - cpu->user = -1; - cpu->nice = -1; - cpu->sys = -1; - cpu->idle = -1; - cpu->wait = -1; - - cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle; - - return SIGAR_OK; -} - -int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_uptime_get(sigar_t *sigar, - sigar_uptime_t *uptime) -{ - uptime->uptime = -1; - - return SIGAR_OK; -} - -int sigar_loadavg_get(sigar_t *sigar, - sigar_loadavg_t *loadavg) -{ - loadavg->loadavg[0] = -1; - loadavg->loadavg[1] = -1; - loadavg->loadavg[2] = -1; - - return SIGAR_OK; -} - -int sigar_proc_list_get(sigar_t *sigar, - sigar_proc_list_t *proclist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_mem_t *procmem) -{ - procmem->size = -1; - procmem->share = -1; - procmem->resident = -1; - procmem->page_faults = -1; - procmem->minor_faults = -1; - procmem->major_faults = -1; - - return SIGAR_OK; -} - -int sigar_proc_cred_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_cred_t *proccred) -{ - proccred->uid = -1; - proccred->gid = -1; - proccred->euid = -1; - proccred->egid = -1; - - return SIGAR_OK; -} - -int sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_time_t *proctime) -{ - proctime->start_time = -1; - proctime->user = -1; - proctime->sys = -1; - proctime->total = proctime->user + proctime->sys; - - return SIGAR_OK; -} - -int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_state_t *procstate) -{ - SIGAR_SSTRCPY(procstate->name, "java"); - procstate->ppid = -1; - procstate->priority = -1; - procstate->nice = -1; - procstate->tty = -1; - procstate->state = 'R'; - procstate->threads = -1; - procstate->processor = -1; - - return SIGAR_OK; -} - -int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_args_t *procargs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_env_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_env_t *procenv) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_fd_t *procfd) -{ - procfd->total = -1; - return SIGAR_OK; -} - -int sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_exe_t *procexe) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_modules_get(sigar_t *sigar, sigar_pid_t pid, - sigar_proc_modules_t *procmods) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_thread_cpu_get(sigar_t *sigar, - sigar_uint64_t id, - sigar_thread_cpu_t *cpu) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_fs_type_get(sigar_file_system_t *fsp) -{ - fsp->type = SIGAR_FSTYPE_UNKNOWN; - - return SIGAR_OK; -} - -int sigar_file_system_list_get(sigar_t *sigar, - sigar_file_system_list_t *fslist) -{ - sigar_file_system_list_create(fslist); - - return SIGAR_OK; -} - -int sigar_disk_usage_get(sigar_t *sigar, const char *name, - sigar_disk_usage_t *usage) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_file_system_usage_get(sigar_t *sigar, - const char *dirname, - sigar_file_system_usage_t *fsusage) -{ - fsusage->total = -1; - fsusage->free = -1; - fsusage->avail = -1; - fsusage->used = -1; - fsusage->files = -1; - fsusage->free_files = -1; - SIGAR_DISK_STATS_INIT(&fsusage->disk); - - return SIGAR_OK; -} - -int sigar_cpu_info_list_get(sigar_t *sigar, - sigar_cpu_info_list_t *cpu_infos) -{ - sigar_cpu_info_t *info; - - sigar_cpu_info_list_create(cpu_infos); - - info = &cpu_infos->data[cpu_infos->number++]; - - SIGAR_SSTRCPY(info->vendor, "vendor"); - SIGAR_SSTRCPY(info->model, "model"); - info->mhz = -1; - info->cache_size = -1; - - return SIGAR_OK; -} - -int sigar_net_route_list_get(sigar_t *sigar, - sigar_net_route_list_t *routelist) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, - sigar_net_interface_stat_t *ifstat) -{ - ifstat->rx_bytes = -1; - ifstat->rx_packets = -1; - ifstat->rx_errors = -1; - ifstat->rx_dropped = -1; - ifstat->rx_overruns = -1; - ifstat->rx_frame = -1; - - ifstat->tx_bytes = -1; - ifstat->tx_packets = -1; - ifstat->tx_errors = -1; - ifstat->tx_dropped = -1; - ifstat->tx_overruns = -1; - ifstat->tx_collisions = -1; - ifstat->tx_carrier = -1; - ifstat->speed = -1; - - return SIGAR_OK; -} - -int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) -{ - return SIGAR_ENOTIMPL; -} - -SIGAR_DECLARE(int) -sigar_tcp_get(sigar_t *sigar, - sigar_tcp_t *tcp) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v2_get(sigar_t *sigar, - sigar_nfs_client_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v2_get(sigar_t *sigar, - sigar_nfs_server_v2_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_client_v3_get(sigar_t *sigar, - sigar_nfs_client_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_nfs_server_v3_get(sigar_t *sigar, - sigar_nfs_server_v3_t *nfs) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_proc_port_get(sigar_t *sigar, int protocol, - unsigned long port, sigar_pid_t *pid) -{ - return SIGAR_ENOTIMPL; -} - -int sigar_os_sys_info_get(sigar_t *sigar, - sigar_sys_info_t *sysinfo) -{ - return SIGAR_OK; -}