[PATCH] users: new applet

Tito farmatito at tiscali.it
Thu Jul 28 05:33:24 UTC 2011


On Wednesday 27 July 2011 23:26:35 you wrote:
> On Wed, Jul 27, 2011 at 6:39 PM, Tito <farmatito at tiscali.it> wrote:
> > On Wednesday 27 July 2011 18:03:48 you wrote:
> >> On Wed, Jul 27, 2011 at 4:43 PM, Tito <farmatito at tiscali.it> wrote:
> >> > On Wednesday 27 July 2011 13:10:49 gotrunks at gmail.com wrote:
> >> >> On Wed, Jul 27, 2011 at 10:29 AM, Tito <farmatito at tiscali.it> wrote:
> >> >> > On Wednesday 27 July 2011 00:33:37 gotrunks at gmail.com wrote:
> >> >> >> Hi,
> >> >> >>
> >> >> >> patch attached.
> >> >> >>
> >> >> >> Regards,
> >> >> >>
> >> >> >
> >> >> > Hi,
> >> >> > printf(ut->ut_user);  maybe adding a format string here would be a good thing.
> >> >>
> >> >> Ok.
> >> >>
> >> >> > BTW.: this code looks very similar to what the who applet does, couldn't
> >> >> > they be merged?
> >> >> >
> >> >>
> >> >> That was the first thing I tried, but I don't know how to do it
> >> >> without unsightly impact the who applet.
> >> >>
> >> >> > Ciao,
> >> >> > Tito
> >> >> > _______________________________________________
> >> >> > busybox mailing list
> >> >> > busybox at busybox.net
> >> >> > http://lists.busybox.net/mailman/listinfo/busybox
> >> >> >
> >> >>
> >> >> Regards,
> >> >>
> >> >
> >> > Hi,
> >> > attached an example patch on how who and users could be merged.
> >> > Denys will love my obfuscated code ;-)
> >> >
> >>
> >> I'm reading your code and I think it's great.
> >>
> >> But maybe it's not perfect. If I'm not wrong, with your patch applied,
> >> a build with defconfig without "users" applet is now a little bigger
> >> (vs bb 19.0.git equivalent config).
> >>
> >> $ make bloatcheck
> >> function                                             old     new   delta
> >> applet_main                                         2776    2784      +8
> >> .rodata                                           148282  148290      +8
> >> applet_names                                        2379    2383      +4
> >> packed_usage                                       28326 28328      +2
> >> applet_nameofs                                       694     696      +2
> >> run_applet_and_exit                                  830     828      -2
> >> ------------------------------------------------------------------------------
> >> (add/remove: 0/0 grow/shrink: 5/1 up/down: 24/-2)              Total: 22 bytes
> >>    text          data     bss     dec     hex filename
> >>  931375          4146    9552  945073   e6bb1 busybox_old
> >>  931381          4146    9552  945079   e6bb7 busybox_unstripped
> >>
> >>
> >> So your patch is a lot better for a busybox build compiled with
> >> "users" & "who" applets, but a little worse for a busybox build
> >> compiled with "who" & without "users". When I was thinking in adding
> >> applets to busybox I didn't want to impact busybox binaries compiled
> >> without this new applets. In fact, if no one added "users" to busybox
> >> probably most systems won't have busybox "users". Maybe it's better to
> >> not hurt this systems.
> >>
> >> Regards
> >>
> >
> > Hi,
> > looks to me like some padding issues or the like as who_main does not show up
> > in bloat-check.  For me old who vs. new who with users disabled:
> >
> 
> I'm stupid, and your patch didn't apply the changes of the other files
> (like Config.src... :)
> 

Ops, forgot about them :-) as it was only a proof of concept
will add them if Denys wants to apply the patch.

Ciao,
Tito


More information about the busybox mailing list