Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Kamil Rytarowski <n54@gmx.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Implement IP_STAT on NetBSD
Date: Mon, 13 Apr 2020 16:43:40 -0400	[thread overview]
Message-ID: <629691cd-1d8b-53e6-46d7-514bf70fe170@simark.ca> (raw)
In-Reply-To: <ea8d4798-1b58-00d4-1425-9c32303b03b1@gmx.com>

On 2020-04-13 4:26 p.m., Kamil Rytarowski wrote:
> On 13.04.2020 22:11, Simon Marchi wrote:
>>> This compat shim is only to emulate Linux... it's possible to follow the
>>> FreeBSD case and just print local kinfo_proc2 as-is (that is fully
>>> OS-specific).
>>>
>>> What do you think?
>>>
>>> The same question applies to IP_STATUS.
>> When you put it like this... it just seems useless to read the info from /proc.
>>
>> If sysctl is guaranteed to always be there and is the blessed way of getting the
>> information, then let's just use that.
> 
> As the kernel emulates Linux in /proc, the stat file is more complete in
> the kernel as there are missing fields (sys/rusage.h ones, eip, esp,
> stack position etc)

Ok, so if you'd like to have this extra information printed, then it could make
sense to try /proc first (if you think it's worth the extra complexity).

>>  The goal is not to emulate Linux, but to
>> use each OS's interface to get the required information.
> 
> Is it fine to print NetBSD specific internals from kinfo_proc2 in
> NetBSD-specific format? Making up Linux-like output will be always
> imperfect, but on the other hand end-users can be confused.

You would have to give some specific examples, but in general it's fine for different
OSes to print different information.  If some process property only exists in NetBSD,
then it should be printed here.  If some process property exists in Linux but not
NetBSD, then it should not be printed here.  Although when we print the same things, we
should strive to print them in a consistent way.

Simon




      reply	other threads:[~2020-04-13 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 18:19 Kamil Rytarowski
2020-04-13 19:16 ` Simon Marchi
2020-04-13 19:43   ` Kamil Rytarowski
2020-04-13 20:11     ` Simon Marchi
2020-04-13 20:26       ` Kamil Rytarowski
2020-04-13 20:43         ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=629691cd-1d8b-53e6-46d7-514bf70fe170@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=n54@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox