[systemd-devel] [PATCH] RFC: util: Avoid memory allocations for formatting paths

2013-04-02 Thread Holger Freyther
From: Holger Hans Peter Freyther Avoid memory allocations to construct the path for files in the procfs. The procfs paths are way shorter than the PATH_MAX so we can use snprintf on a string located on the stack. This shows up as a win on x86 using the benchmark program below. $ make libsystemd-

Re: [systemd-devel] [PATCH 1/2] RFC: util: Avoid memory allocations for formatting paths

2013-04-02 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Apr 02, 2013 at 10:35:50PM +0200, Holger Freyther wrote: > +#define format_procfs_path(buffer, path, pid) \ > +snprintf(buffer, sizeof(buffer) - 1, "/proc/%lu/%s", (unsigned long) > pid, path); \ > +char_array_0(buffer); > + Hi, Lennart recently implemented a smarter way to

Re: [systemd-devel] [PATCH 1/2] RFC: util: Avoid memory allocations for formatting paths

2013-04-02 Thread Holger Freyther
Ian Pilcher gmail.com> writes: > http://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html thanks, good point. I will add a do {} while(0) around it. ___ systemd-devel mailing list [email protected] http://lists.freedesktop

Re: [systemd-devel] [PATCH 1/2] RFC: util: Avoid memory allocations for formatting paths

2013-04-02 Thread Ian Pilcher
On 04/02/2013 03:35 PM, Holger Freyther wrote: > +#define format_procfs_path(buffer, path, pid) \ > +snprintf(buffer, sizeof(buffer) - 1, "/proc/%lu/%s", (unsigned long) > pid, path); \ > +char_array_0(buffer); http://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html -- =

[systemd-devel] [PATCH 1/2] RFC: util: Avoid memory allocations for formatting paths

2013-04-02 Thread Holger Freyther
From: Holger Hans Peter Freyther Avoid memory allocations to construct the path for files in the procfs. The procfs paths are way shorter than the PATH_MAX so we can use snprintf on a string located on the stack. This shows up as a win on x86 using the benchmark program below. $ make libsystemd-

[systemd-devel] [PATCH 2/2] RFC: util: Avoid doing work on the string when it is not used

2013-04-02 Thread Holger Freyther
From: Holger Hans Peter Freyther The routine is dominated by the fgets and not the code that is moved around. Doing the work only for the lines that will be used should be a small gain. Routines in the selinux-access.c should probably query the gid and uid at the same time instead of opening and

[systemd-devel] New Qt wrapper: libsystemd-qt

2013-04-02 Thread Andrea Scarpino
Hi all, I'm new to this mailing list, but I want to introduce a new Qt library for the systemd API: libsystemd-qt[1]. One year and half ago another developer, Stefan Majewsky, announced the same work[2], but since then there has been no development of that library[3]. That library never built fo

Re: [systemd-devel] [PATCH] cgtop: Add cpu time opt and become stdout sensitive

2013-04-02 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Apr 02, 2013 at 06:52:16PM +0200, Umut Tezduyar wrote: > --- > src/cgtop/cgtop.c | 122 > ++--- > 1 files changed, 88 insertions(+), 34 deletions(-) Hi Umut, patch is applied. I removed the header when !on_tty() - I don't think it has any u

Re: [systemd-devel] [HEADSUP] New module ‘libc’ in systemd git

2013-04-02 Thread Robert Schwebel
On Tue, Apr 02, 2013 at 02:26:14PM +0200, Lennart Poettering wrote: > > I just added a new module to systemd git, “libc”, and you are probably > > wondering what that is about. Here’s a quick overview over what this is > > and our plans with it. > > For the sake of the archives, and since this appa

Re: [systemd-devel] [PATCH] [RFCv4] Add Listen* to dbus properties

2013-04-02 Thread Kok, Auke-jan H
On Tue, Apr 2, 2013 at 6:29 AM, Zbigniew Jędrzejewski-Szmek wrote: > On Tue, Apr 02, 2013 at 08:26:17AM +0200, Tomasz Torcz wrote: >> On Tue, Apr 02, 2013 at 05:54:32AM +0200, Zbigniew Jędrzejewski-Szmek wrote: >> > On Mon, Apr 01, 2013 at 11:09:45PM +0300, Oleksii Shevchuk wrote: >> > > sockets.s

Re: [systemd-devel] [PATCH] cgtop: Add cpu time opt and become stdout sensitive

2013-04-02 Thread Umut Tezduyar
Hi, I have resubmitted the patch with agreed changes. My usecase is pretty simple actually. I would like to store process time of services right after default.target and store the values in a database. That involves running cgtop 1 time and parsing the output. Thanks. On Mon, Apr 1, 2013 at 2:

[systemd-devel] [PATCH] cgtop: Add cpu time opt and become stdout sensitive

2013-04-02 Thread Umut Tezduyar
--- src/cgtop/cgtop.c | 122 ++--- 1 files changed, 88 insertions(+), 34 deletions(-) diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index eebebf0..f124826 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -19,9 +19,11 @@ along with

Re: [systemd-devel] [HEADSUP] New module ‘libc’ in systemd git

2013-04-02 Thread Lennart Poettering
On Tue, 02.04.13 15:20, Colin Guthrie ([email protected]) wrote: > 'Twas brillig, and Lennart Poettering at 02/04/13 13:26 did gyre and gimble: > > On Mon, 01.04.13 02:22, Lennart Poettering ([email protected]) wrote: > > > >> Heya, > >> > >> I just added a new module to systemd git, “lib

Re: [systemd-devel] [HEADSUP] New module ‘libc’ in systemd git

2013-04-02 Thread Colin Guthrie
'Twas brillig, and Lennart Poettering at 02/04/13 13:26 did gyre and gimble: > On Mon, 01.04.13 02:22, Lennart Poettering ([email protected]) wrote: > >> Heya, >> >> I just added a new module to systemd git, “libc”, and you are probably >> wondering what that is about. Here’s a quick overview

Re: [systemd-devel] [PATCH] [RFCv4] Add Listen* to dbus properties

2013-04-02 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Apr 02, 2013 at 08:26:17AM +0200, Tomasz Torcz wrote: > On Tue, Apr 02, 2013 at 05:54:32AM +0200, Zbigniew Jędrzejewski-Szmek wrote: > > On Mon, Apr 01, 2013 at 11:09:45PM +0300, Oleksii Shevchuk wrote: > > > sockets.socket - Test > > > Loaded: loaded (/home/alxchk/.config/systemd/user/

Re: [systemd-devel] [HEADSUP] New module ‘libc’ in systemd git

2013-04-02 Thread Lennart Poettering
On Mon, 01.04.13 02:22, Lennart Poettering ([email protected]) wrote: > Heya, > > I just added a new module to systemd git, “libc”, and you are probably > wondering what that is about. Here’s a quick overview over what this is > and our plans with it. For the sake of the archives, and since

Re: [systemd-devel] Duplicate assignment of kernel/sysrq

2013-04-02 Thread Harald Hoyer
Am 02.04.2013 01:53, schrieb Reindl Harald: > > > Am 02.04.2013 01:28, schrieb Tom Gundersen: >> That said, the fact that we are currently parsing /etc/sysctl.conf is >> not documented > > and you broke it completly in Fedora 18 which is why the serivice > below exists to get "net.ipv4.ip_forwar

Re: [systemd-devel] Shared root fs by default

2013-04-02 Thread Tvrtko Ursulin
Hi, On Friday 29 March 2013 15:56:01 Lennart Poettering wrote: > On Thu, 28.03.13 16:47, Tvrtko Ursulin ([email protected]) wrote: > > Hi all, > > > > As a bit of a feedback, the change in systemd to mark root fs as > > recursively shared by default has the potential to bite hard anyon

Re: [systemd-devel] /var/log/journal/

2013-04-02 Thread Umut Tezduyar
Hi, I am seeing the same behavior since I switched from 197 to 198. I have the default journal.conf and all my logs go under /var/log/journal (My /var is tmpfs) where before they were going under /run/log/journal. I haven't investigated it but maybe the default configuration for Storage= is now pe

[systemd-devel] [PATCH] Add some extra __attribute__ ((format)) s

2013-04-02 Thread Cristian Rodríguez
diff --git a/src/core/manager.h b/src/core/manager.h index 9d8d943..cd1ef23 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -301,6 +301,6 @@ void manager_undo_generators(Manager *m); void manager_recheck_journal(Manager *m); void manager_set_show_status(Manager *m, bool b); -void m