diff mbox

[v2] package/sysdig: New package

Message ID 1426589808-568-1-git-send-email-angelo.compagnucci@gmail.com
State Superseded
Headers show

Commit Message

Angelo Compagnucci March 17, 2015, 10:56 a.m. UTC
Sysdig is open source, system-level exploration:
capture system state and activity from a running Linux
instance, then save, filter and analyze.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---

Changes v1 -> v2:
  - Changed "depends on" with "select" for dependencies (suggested by Baruch)
  - Added comment "sysdig needs a Linux kernel to be built" (suggested by Baruch)
  - Upgreded to recently released 0.1.99

 package/Config.in        |  1 +
 package/sysdig/Config.in | 17 +++++++++++++++++
 package/sysdig/sysdig.mk | 22 ++++++++++++++++++++++
 3 files changed, 40 insertions(+)
 create mode 100644 package/sysdig/Config.in
 create mode 100644 package/sysdig/sysdig.mk

Comments

Baruch Siach March 17, 2015, 11:23 a.m. UTC | #1
Hi Angelo,

On Tue, Mar 17, 2015 at 11:56:48AM +0100, Angelo Compagnucci wrote:
> diff --git a/package/sysdig/Config.in b/package/sysdig/Config.in
> new file mode 100644
> index 0000000..94b088f
> --- /dev/null
> +++ b/package/sysdig/Config.in
> @@ -0,0 +1,17 @@
> +comment "sysdig needs a Linux kernel to be built"
> +	depends on !BR2_LINUX_KERNEL
> +
> +config BR2_PACKAGE_SYSDIG
> +	bool "sysdig"
> +	select BR2_PACKAGE_ZLIB
> +	select BR2_PACKAGE_LUAJIT
> +	select BR2_PACKAGE_LIBJSON

This packages also needs to depend on all the dependencies of these packages. 
Please read the whole section under 
http://nightly.buildroot.org/manual.html#depends-on-vs-select.

> +	depends on BR2_LINUX_KERNEL
> +	help
> +	  Sysdig is open source, system-level exploration:
> +	  capture system state and activity from a running Linux instance,
> +	  then save, filter and analyze.
> +	  Think of it as strace + tcpdump + lsof + awesome sauce.
> +	  With a little Lua cherry on top.
> +
> +	  http://sysdig.org

A dependencies comment is still missing here 
(http://nightly.buildroot.org/manual.html#_dependencies_on_a_linux_kernel_built_by_buildroot).

baruch
Angelo Compagnucci March 17, 2015, 11:31 a.m. UTC | #2
Hi Baruch,

2015-03-17 12:23 GMT+01:00 Baruch Siach <baruch@tkos.co.il>:
> Hi Angelo,
>
> On Tue, Mar 17, 2015 at 11:56:48AM +0100, Angelo Compagnucci wrote:
>> diff --git a/package/sysdig/Config.in b/package/sysdig/Config.in
>> new file mode 100644
>> index 0000000..94b088f
>> --- /dev/null
>> +++ b/package/sysdig/Config.in
>> @@ -0,0 +1,17 @@
>> +comment "sysdig needs a Linux kernel to be built"
>> +     depends on !BR2_LINUX_KERNEL
>> +
>> +config BR2_PACKAGE_SYSDIG
>> +     bool "sysdig"
>> +     select BR2_PACKAGE_ZLIB
>> +     select BR2_PACKAGE_LUAJIT
>> +     select BR2_PACKAGE_LIBJSON
>
> This packages also needs to depend on all the dependencies of these packages.
> Please read the whole section under
> http://nightly.buildroot.org/manual.html#depends-on-vs-select.

Now I understand because Thomas Petazzoni suggests to use depends on
insted of select!

>
>> +     depends on BR2_LINUX_KERNEL
>> +     help
>> +       Sysdig is open source, system-level exploration:
>> +       capture system state and activity from a running Linux instance,
>> +       then save, filter and analyze.
>> +       Think of it as strace + tcpdump + lsof + awesome sauce.
>> +       With a little Lua cherry on top.
>> +
>> +       http://sysdig.org
>
> A dependencies comment is still missing here
> (http://nightly.buildroot.org/manual.html#_dependencies_on_a_linux_kernel_built_by_buildroot).

The comment is there:

@@ -0,0 +1,17 @@
+comment "sysdig needs a Linux kernel to be built"
+ depends on !BR2_LINUX_KERNEL

Sincerely, Angelo

>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
Baruch Siach March 17, 2015, 11:48 a.m. UTC | #3
Hi Angelo,

On Tue, Mar 17, 2015 at 12:31:48PM +0100, Angelo Compagnucci wrote:
> 2015-03-17 12:23 GMT+01:00 Baruch Siach <baruch@tkos.co.il>:
> > On Tue, Mar 17, 2015 at 11:56:48AM +0100, Angelo Compagnucci wrote:
> >> +     depends on BR2_LINUX_KERNEL
> >> +     help
> >> +       Sysdig is open source, system-level exploration:
> >> +       capture system state and activity from a running Linux instance,
> >> +       then save, filter and analyze.
> >> +       Think of it as strace + tcpdump + lsof + awesome sauce.
> >> +       With a little Lua cherry on top.
> >> +
> >> +       http://sysdig.org
> >
> > A dependencies comment is still missing here
> > (http://nightly.buildroot.org/manual.html#_dependencies_on_a_linux_kernel_built_by_buildroot).
> 
> The comment is there:
> 
> @@ -0,0 +1,17 @@
> +comment "sysdig needs a Linux kernel to be built"
> + depends on !BR2_LINUX_KERNEL

You are right, I missed that. It's just that I'm used to see these comments 
below the main 'config' section. Putting the comment above is also fine, 
though. Don't forget to update this comment when adding indirect dependencies.

baruch
Angelo Compagnucci March 17, 2015, 11:59 a.m. UTC | #4
Dear Baruch Siach,

2015-03-17 12:48 GMT+01:00 Baruch Siach <baruch@tkos.co.il>:
> Hi Angelo,
>
> On Tue, Mar 17, 2015 at 12:31:48PM +0100, Angelo Compagnucci wrote:
>> 2015-03-17 12:23 GMT+01:00 Baruch Siach <baruch@tkos.co.il>:
>> > On Tue, Mar 17, 2015 at 11:56:48AM +0100, Angelo Compagnucci wrote:
>> >> +     depends on BR2_LINUX_KERNEL
>> >> +     help
>> >> +       Sysdig is open source, system-level exploration:
>> >> +       capture system state and activity from a running Linux instance,
>> >> +       then save, filter and analyze.
>> >> +       Think of it as strace + tcpdump + lsof + awesome sauce.
>> >> +       With a little Lua cherry on top.
>> >> +
>> >> +       http://sysdig.org
>> >
>> > A dependencies comment is still missing here
>> > (http://nightly.buildroot.org/manual.html#_dependencies_on_a_linux_kernel_built_by_buildroot).
>>
>> The comment is there:
>>
>> @@ -0,0 +1,17 @@
>> +comment "sysdig needs a Linux kernel to be built"
>> + depends on !BR2_LINUX_KERNEL
>
> You are right, I missed that. It's just that I'm used to see these comments
> below the main 'config' section. Putting the comment above is also fine,
> though. Don't forget to update this comment when adding indirect dependencies.

I think that if I use select, the dependencies of this package will
explode. I think I can use select for simple, non problematic
packages, and use depends on for others.

I'll submit a patch in minutes!

Sincerely, Angelo

>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
Thomas Petazzoni March 17, 2015, 1:12 p.m. UTC | #5
Dear Angelo Compagnucci,

On Tue, 17 Mar 2015 12:59:11 +0100, Angelo Compagnucci wrote:

> > You are right, I missed that. It's just that I'm used to see these comments
> > below the main 'config' section. Putting the comment above is also fine,
> > though. Don't forget to update this comment when adding indirect dependencies.
> 
> I think that if I use select, the dependencies of this package will
> explode. I think I can use select for simple, non problematic
> packages, and use depends on for others.

No. Please follow what Baruch said: use 'select' for BR2_PACKAGE_ZLIB,
BR2_PACKAGE_LUAJIT and BR2_PACKAGE_LIBJSON, and a 'depends on' for
BR2_LINUX_KERNEL.

Also, are you sure sysdig only works with LuaJIT, or does it also work
with the "normal" Lua interpreter?

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index e221deb..019d40b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -94,6 +94,7 @@  endif
 	source "package/strace/Config.in"
 	source "package/stress/Config.in"
 	source "package/sysprof/Config.in"
+	source "package/sysdig/Config.in"
 	source "package/tinymembench/Config.in"
 	source "package/trace-cmd/Config.in"
 	source "package/trinity/Config.in"
diff --git a/package/sysdig/Config.in b/package/sysdig/Config.in
new file mode 100644
index 0000000..94b088f
--- /dev/null
+++ b/package/sysdig/Config.in
@@ -0,0 +1,17 @@ 
+comment "sysdig needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_SYSDIG
+	bool "sysdig"
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LUAJIT
+	select BR2_PACKAGE_LIBJSON
+	depends on BR2_LINUX_KERNEL
+	help
+	  Sysdig is open source, system-level exploration:
+	  capture system state and activity from a running Linux instance,
+	  then save, filter and analyze.
+	  Think of it as strace + tcpdump + lsof + awesome sauce.
+	  With a little Lua cherry on top.
+
+	  http://sysdig.org
diff --git a/package/sysdig/sysdig.mk b/package/sysdig/sysdig.mk
new file mode 100644
index 0000000..62b9344
--- /dev/null
+++ b/package/sysdig/sysdig.mk
@@ -0,0 +1,22 @@ 
+#############################################################
+#
+# sysdig
+#
+#############################################################
+
+SYSDIG_VERSION = 0.1.99
+SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
+SYSDIG_LICENSE = GPLv2
+SYSDIG_LICENSE_FILES = COPYING
+SYSDIG_CONF_OPTS = -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_ZLIB=OFF
+SYSDIG_DEPENDENCIES += zlib luajit libjson linux
+SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
+
+define SYSDIG_INSTALL_DRIVER
+	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D)/driver modules
+	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D)/driver modules_install
+endef
+
+SYSDIG_POST_INSTALL_TARGET_HOOKS += SYSDIG_INSTALL_DRIVER
+
+$(eval $(cmake-package))