summaryrefslogtreecommitdiff
path: root/vendor/github.com/power-devops/perfstat/lparstat.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/power-devops/perfstat/lparstat.go')
-rw-r--r--vendor/github.com/power-devops/perfstat/lparstat.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/power-devops/perfstat/lparstat.go b/vendor/github.com/power-devops/perfstat/lparstat.go
new file mode 100644
index 0000000..0ce35e3
--- /dev/null
+++ b/vendor/github.com/power-devops/perfstat/lparstat.go
@@ -0,0 +1,26 @@
+// +build aix
+
+package perfstat
+
+/*
+#cgo LDFLAGS: -lperfstat
+
+#include <libperfstat.h>
+*/
+import "C"
+
+import (
+ "fmt"
+)
+
+func PartitionStat() (*PartitionConfig, error) {
+ var part C.perfstat_partition_config_t
+
+ rc := C.perfstat_partition_config(nil, &part, C.sizeof_perfstat_partition_config_t, 1)
+ if rc != 1 {
+ return nil, fmt.Errorf("perfstat_partition_config() error")
+ }
+ p := perfstatpartitionconfig2partitionconfig(part)
+ return &p, nil
+
+}