Skip to content

Commit

Permalink
Merge branch 'agent-release-9-6-0' into agent-master-3
Browse files Browse the repository at this point in the history
  • Loading branch information
gnosek committed Feb 20, 2020
2 parents d0530f9 + 0de2260 commit 20216e5
Show file tree
Hide file tree
Showing 21 changed files with 481 additions and 279 deletions.
12 changes: 10 additions & 2 deletions .travis-scripts/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@
# limitations under the License.
#
set -e
export CC="gcc-4.8"
export CXX="g++-4.8"

arch="$(uname -i)"

if [[ "$arch" == "s390x" ]] || [[ "$arch" == "ppc64le" ]]; then
export CC="gcc-7"
export CXX="g++-7"
else
export CC="gcc-4.8"
export CXX="g++-4.8"
fi
wget https://s3.amazonaws.com/download.draios.com/dependencies/cmake-3.3.2.tar.gz
tar -xzf cmake-3.3.2.tar.gz
cd cmake-3.3.2
Expand Down
6 changes: 5 additions & 1 deletion .travis-scripts/linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
sudo apt-get --force-yes install g++-4.8
arch="$(uname -i)"

if [[ "$arch" != "s390x" ]] && [[ "$arch" != "ppc64le" ]]; then
sudo apt-get --force-yes install g++-4.8
fi
sudo apt-get install rpm linux-headers-$(uname -r) libelf-dev
sudo apt-get purge cmake
34 changes: 28 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,34 @@
# limitations under the License.
#
language: c
os:
- linux
- osx
env:
- BUILD_TYPE=Debug
- BUILD_TYPE=Release

matrix:
include:
- env: BUILD_TYPE=Debug
os: linux
- env: BUILD_TYPE=Release
os: linux
- env: BUILD_TYPE=Debug
os: osx
- env: BUILD_TYPE=Release
os: osx
- env: BUILD_TYPE=Debug
os: linux
arch: ppc64le
dist: bionic
- env: BUILD_TYPE=Release
os: linux
arch: ppc64le
dist: bionic
- env: BUILD_TYPE=Debug
os: linux
arch: s390x
dist: bionic
- env: BUILD_TYPE=Release
os: linux
arch: s390x
dist: bionic

sudo: required
services:
- docker
Expand Down
64 changes: 50 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,27 @@ else()
set(LUAJIT_INCLUDE "${LUAJIT_SRC}")
if(NOT WIN32)
set(LUAJIT_LIB "${LUAJIT_SRC}/libluajit.a")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le")
ExternalProject_Add(luajit
GIT_REPOSITORY "https://github.com/moonjit/moonjit"
GIT_TAG "2.1.2"
PATCH_COMMAND sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/chisel.cpp && sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser.cpp && sed -i "s/luaL_getn/lua_objlen /g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser_api.cpp
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
INSTALL_COMMAND "")
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "s390x")
ExternalProject_Add(luajit
GIT_REPOSITORY "https://github.com/linux-on-ibm-z/LuaJIT.git"
GIT_TAG "v2.1"
PATCH_COMMAND sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/chisel.cpp && sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser.cpp && sed -i "s/luaL_getn/lua_objlen /g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser_api.cpp
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
INSTALL_COMMAND "")
else()
ExternalProject_Add(luajit
URL "http://download.draios.com/dependencies/LuaJIT-2.0.3.tar.gz"
URL_MD5 "f14e9104be513913810cd59c8c658dc0"
Expand All @@ -168,6 +189,7 @@ else()
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
INSTALL_COMMAND "")
endif()
else()
set(LUAJIT_LIB "${LUAJIT_SRC}/lua51.lib")
ExternalProject_Add(luajit
Expand Down Expand Up @@ -464,17 +486,31 @@ if(NOT WIN32 AND NOT APPLE)
set(PROTOC "${PROTOBUF_SRC}/target/bin/protoc")
set(PROTOBUF_INCLUDE "${PROTOBUF_SRC}/target/include")
set(PROTOBUF_LIB "${PROTOBUF_SRC}/target/lib/libprotobuf.a")
ExternalProject_Add(protobuf
DEPENDS openssl zlib
URL "http://download.sysdig.com/dependencies/protobuf-cpp-3.5.0.tar.gz"
URL_MD5 "e4ba8284a407712168593e79e6555eb2"
# TODO what if using system zlib?
CONFIGURE_COMMAND /usr/bin/env CPPFLAGS=-I${ZLIB_INCLUDE} LDFLAGS=-L${ZLIB_SRC} ./configure --with-zlib --prefix=${PROTOBUF_SRC}/target
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${PROTOC} ${PROTOBUF_INCLUDE} ${PROTOBUF_LIB}
# TODO s390x support
INSTALL_COMMAND make install)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "s390x")
ExternalProject_Add(protobuf
DEPENDS openssl zlib
URL "http://download.sysdig.com/dependencies/protobuf-cpp-3.5.0.tar.gz"
URL_MD5 "e4ba8284a407712168593e79e6555eb2"
PATCH_COMMAND wget http://download.sysdig.com/dependencies/protobuf-3.5.0-s390x.patch && patch -p1 -i protobuf-3.5.0-s390x.patch
# TODO what if using system zlib?
CONFIGURE_COMMAND /usr/bin/env CPPFLAGS=-I${ZLIB_INCLUDE} LDFLAGS=-L${ZLIB_SRC} ./configure --with-zlib --prefix=${PROTOBUF_SRC}/target
COMMAND aclocal && automake
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${PROTOC} ${PROTOBUF_INCLUDE} ${PROTOBUF_LIB}
INSTALL_COMMAND make install)
else()
ExternalProject_Add(protobuf
DEPENDS openssl zlib
URL "http://download.sysdig.com/dependencies/protobuf-cpp-3.5.0.tar.gz"
URL_MD5 "e4ba8284a407712168593e79e6555eb2"
# TODO what if using system zlib?
CONFIGURE_COMMAND /usr/bin/env CPPFLAGS=-I${ZLIB_INCLUDE} LDFLAGS=-L${ZLIB_SRC} ./configure --with-zlib --prefix=${PROTOBUF_SRC}/target
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${PROTOC} ${PROTOBUF_INCLUDE} ${PROTOBUF_LIB}
INSTALL_COMMAND make install)
endif()
endif()

option(USE_BUNDLED_GRPC "Enable building of the bundled grpc" ${USE_BUNDLED_DEPS})
Expand Down Expand Up @@ -581,7 +617,7 @@ if(CREATE_TEST_TARGETS AND NOT WIN32)
# This is preferred vs using ctest's add_test because it will build
# the code and output to stdout.
add_custom_target(run-unit-tests
COMMAND $(MAKE) run-unit-test-libsinsp
COMMAND ${CMAKE_MAKE_PROGRAM} run-unit-test-libsinsp
)
endif()

Expand All @@ -598,12 +634,12 @@ set(CPACK_GENERATOR DEB RPM TGZ)

set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sysdig <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.sysdig.org")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.sysdig.com")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "dkms (>= 2.1.0.0)")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/scripts/debian/postinst;${CMAKE_BINARY_DIR}/scripts/debian/prerm")

set(CPACK_RPM_PACKAGE_LICENSE "Apache v2.0")
set(CPACK_RPM_PACKAGE_URL "http://www.sysdig.org")
set(CPACK_RPM_PACKAGE_URL "http://www.sysdig.com")
set(CPACK_RPM_PACKAGE_REQUIRES "dkms, gcc, make, kernel-devel, perl")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/scripts/rpm/postinstall")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/scripts/rpm/preuninstall")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sysdig

Where to start?
---
If this is your first time hearing about sysdig, we recommend you [start with the website](http://www.sysdig.org).
If this is your first time hearing about sysdig, we recommend you [start with the website](http://www.sysdig.com).

What does sysdig do and why should I use it?
---
Expand Down
4 changes: 4 additions & 0 deletions driver/bpf/filler_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,9 @@ static __always_inline int bpf_val_to_ring_type(struct filler_data *data,

static __always_inline bool bpf_in_ia32_syscall()
{
#ifdef __ppc64__
return 0;
#else
struct task_struct *task;
u32 status;

Expand All @@ -947,6 +950,7 @@ static __always_inline bool bpf_in_ia32_syscall()
#endif

return status & TS_COMPAT;
#endif // #ifdef __ppc64__
}

#endif
1 change: 1 addition & 0 deletions driver/ppm.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ or GPL2.txt for full copies of the license.
#define PPM_PORT_MYSQL 3306
#define PPM_PORT_POSTGRES 5432
#define PPM_PORT_STATSD 8125
#define PPM_PORT_MONGODB 27017

/*
* The ring descriptor.
Expand Down
Loading

0 comments on commit 20216e5

Please sign in to comment.