Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/pr/2276'
Browse files Browse the repository at this point in the history
  • Loading branch information
octo committed Jul 19, 2017
2 parents f10aace + ebffc2b commit 88bd89f
Show file tree
Hide file tree
Showing 8 changed files with 735 additions and 1 deletion.
5 changes: 5 additions & 0 deletions AUTHORS
Expand Up @@ -285,6 +285,11 @@ Scott Sanders <scott at jssjr.com>
Sebastien Pahl <sebastien.pahl at dotcloud.com>
- AMQP plugin.

Serhiy Pshyk <serhiyx.pshyk at intel.com>
- intel_pmu plugin
- intel_rdt plugin
- snmp_agent plugin

Simon Kuhnle <simon at blarzwurst.de>
- OpenBSD code for the cpu and memory plugins.

Expand Down
8 changes: 8 additions & 0 deletions Makefile.am
Expand Up @@ -888,6 +888,14 @@ hugepages_la_SOURCES = src/hugepages.c
hugepages_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif

if BUILD_PLUGIN_INTEL_PMU
pkglib_LTLIBRARIES += intel_pmu.la
intel_pmu_la_SOURCES = src/intel_pmu.c
intel_pmu_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBJEVENTS_CPPFLAGS)
intel_pmu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBJEVENTS_LDFLAGS)
intel_pmu_la_LIBADD = $(BUILD_WITH_LIBJEVENTS_LIBS)
endif

if BUILD_PLUGIN_INTEL_RDT
pkglib_LTLIBRARIES += intel_rdt.la
intel_rdt_la_SOURCES = src/intel_rdt.c
Expand Down
14 changes: 13 additions & 1 deletion README
Expand Up @@ -140,6 +140,11 @@ Features
hugepages can be found here:
https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt.

- intel_pmu
The intel_pmu plugin reads performance counters provided by the Linux
kernel perf interface. The plugin uses jevents library to resolve named
events to perf events and access perf interface.

- intel_rdt
The intel_rdt plugin collects information provided by monitoring features
of Intel Resource Director Technology (Intel(R) RDT) like Cache Monitoring
Expand Down Expand Up @@ -240,7 +245,7 @@ Features

- netapp
Plugin to query performance values from a NetApp storage system using the
“Manage ONTAP” SDK provided by NetApp.
“Manage ONTAP” SDK provided by NetApp.

- netlink
Very detailed Linux network interface and routing statistics. You can get
Expand Down Expand Up @@ -786,6 +791,13 @@ Prerequisites
For querying iptables counters.
<http://netfilter.org/>

* libjevents (optional)
The jevents library is used by the `intel_pmu' plugin to access the Linux
kernel perf interface.
Note: the library should be build with -fPIC flag to be linked with
intel_pmu shared object correctly.
<https://github.com/andikleen/pmu-tools>

* libjvm (optional)
Library that encapsulates the `Java Virtual Machine' (JVM). This library is
used by the `java' plugin to execute Java bytecode.
Expand Down
47 changes: 47 additions & 0 deletions configure.ac
Expand Up @@ -4429,6 +4429,49 @@ AC_SUBST([BUILD_WITH_LIBPQOS_LDFLAGS])
AC_SUBST([BUILD_WITH_LIBPQOS_LIBS])
# }}}
# --with-libjevents {{{
with_libjevents_cppflags=""
with_libjevents_ldflags=""
AC_ARG_WITH([libjevents],
[AS_HELP_STRING([--with-libjevents@<:@=PREFIX@:>@], [Path to libjevents.])],
[
if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
with_libjevents_cppflags="-I$withval/include"
with_libjevents_ldflags="-L$withval/lib"
with_libjevents="yes"
else
with_libjevents="$withval"
fi
],
[with_libjevents="yes"]
)
if test "x$with_libjevents" = "xyes"; then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_libjevents_cppflags"
AC_CHECK_HEADERS([jevents.h], [with_libjevents="yes"], [with_libjevents="no (jevents.h not found)"])
CPPFLAGS="$SAVE_CPPFLAGS"
fi
if test "x$with_libjevents" = "xyes"; then
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $with_libjevents_ldflags"
AC_CHECK_LIB([jevents], [json_events], [with_libjevents="yes"], [with_libjevents="no (Can't find libjevents)"])
LDFLAGS="$SAVE_LDFLAGS"
fi
if test "x$with_libjevents" = "xyes"; then
BUILD_WITH_LIBJEVENTS_CPPFLAGS="$with_libjevents_cppflags"
BUILD_WITH_LIBJEVENTS_LDFLAGS="$with_libjevents_ldflags"
BUILD_WITH_LIBJEVENTS_LIBS="-ljevents"
fi
AC_SUBST([BUILD_WITH_LIBJEVENTS_CPPFLAGS])
AC_SUBST([BUILD_WITH_LIBJEVENTS_LDFLAGS])
AC_SUBST([BUILD_WITH_LIBJEVENTS_LIBS])
# }}}
# --with-libprotobuf {{{
with_libprotobuf_cppflags=""
with_libprotobuf_ldflags=""
Expand Down Expand Up @@ -6083,6 +6126,7 @@ plugin_fscache="no"
plugin_gps="no"
plugin_grpc="no"
plugin_hugepages="no"
plugin_intel_pmu="no"
plugin_intel_rdt="no"
plugin_interface="no"
plugin_ipc="no"
Expand Down Expand Up @@ -6491,6 +6535,7 @@ AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
AC_PLUGIN([intel_pmu], [$with_libjevents], [Intel performance monitor plugin])
AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
Expand Down Expand Up @@ -6809,6 +6854,7 @@ AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
AC_MSG_RESULT([ libjevents . . . . . $with_libjevents])
AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
Expand Down Expand Up @@ -6907,6 +6953,7 @@ AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
AC_MSG_RESULT([ intel_pmu . . . . . . $enable_intel_pmu])
AC_MSG_RESULT([ intel_rdt . . . . . . $enable_intel_rdt])
AC_MSG_RESULT([ interface . . . . . . $enable_interface])
AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
Expand Down
1 change: 1 addition & 0 deletions contrib/systemd.collectd.service
Expand Up @@ -19,6 +19,7 @@ ProtectHome=true
# dns CAP_NET_RAW
# exec CAP_SETUID CAP_SETGID
# intel_rdt CAP_SYS_RAWIO
# intel_pmu CAP_SYS_ADMIN
# iptables CAP_NET_ADMIN
# ping CAP_NET_RAW
# smart CAP_SYS_RAWIO
Expand Down
9 changes: 9 additions & 0 deletions src/collectd.conf.in
Expand Up @@ -129,6 +129,7 @@
#@BUILD_PLUGIN_GRPC_TRUE@LoadPlugin grpc
#@BUILD_PLUGIN_HDDTEMP_TRUE@LoadPlugin hddtemp
#@BUILD_PLUGIN_HUGEPAGES_TRUE@LoadPlugin hugepages
#@BUILD_PLUGIN_INTEL_PMU_TRUE@LoadPlugin intel_pmu
#@BUILD_PLUGIN_INTEL_RDT_TRUE@LoadPlugin intel_rdt
@BUILD_PLUGIN_INTERFACE_TRUE@@BUILD_PLUGIN_INTERFACE_TRUE@LoadPlugin interface
#@BUILD_PLUGIN_IPC_TRUE@LoadPlugin ipc
Expand Down Expand Up @@ -645,6 +646,14 @@
# ValuesPercentage false
#</Plugin>

#<Plugin intel_pmu>
# ReportHardwareCacheEvents true
# ReportKernelPMUEvents true
# ReportSoftwareEvents true
# EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json"
# HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
#</Plugin>

#<Plugin "intel_rdt">
# Cores "0-2"
#</Plugin>
Expand Down
86 changes: 86 additions & 0 deletions src/collectd.conf.pod
Expand Up @@ -3073,6 +3073,92 @@ Defaults to B<false>.

=back

=head2 Plugin C<intel_pmu>

The I<intel_pmu> plugin collects performance counters data on Intel CPUs using
Linux perf interface. All events are reported on a per core basis.

B<Synopsis:>

<Plugin intel_pmu>
ReportHardwareCacheEvents true
ReportKernelPMUEvents true
ReportSoftwareEvents true
EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json"
HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
</Plugin>

B<Options:>

=over 4

=item B<ReportHardwareCacheEvents> B<false>|B<true>

Enable or disable measuring of hardware CPU cache events:
- L1-dcache-loads
- L1-dcache-load-misses
- L1-dcache-stores
- L1-dcache-store-misses
- L1-dcache-prefetches
- L1-dcache-prefetch-misses
- L1-icache-loads
- L1-icache-load-misses
- L1-icache-prefetches
- L1-icache-prefetch-misses
- LLC-loads
- LLC-load-misses
- LLC-stores
- LLC-store-misses
- LLC-prefetches
- LLC-prefetch-misses
- dTLB-loads
- dTLB-load-misses
- dTLB-stores
- dTLB-store-misses
- dTLB-prefetches
- dTLB-prefetch-misses
- iTLB-loads
- iTLB-load-misses
- branch-loads
- branch-load-misses

=item B<ReportKernelPMUEvents> B<false>|B<true>

Enable or disable measuring of the following events:
- cpu-cycles
- instructions
- cache-references
- cache-misses
- branches
- branch-misses
- bus-cycles

=item B<ReportSoftwareEvents> B<false>|B<true>

Enable or disable measuring of software events provided by kernel:
- cpu-clock
- task-clock
- context-switches
- cpu-migrations
- page-faults
- minor-faults
- major-faults
- alignment-faults
- emulation-faults

=item B<EventList> I<filename>

JSON performance counter event list file name. To be able to monitor all Intel
CPU specific events JSON event list file should be downloaded. Use the pmu-tools
event_download.py script to download event list for current CPU.

=item B<HardwareEvents> I<events>

This field is a list of event names or groups of comma separated event names.
This option requires B<EventList> option to be configured.

=back

=head2 Plugin C<intel_rdt>

The I<intel_rdt> plugin collects information provided by monitoring features of
Expand Down

0 comments on commit 88bd89f

Please sign in to comment.