public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Cc: Oleksandr Gavenko <gavenkoa@gmail.com>
Subject: Re: procmon doesn't capture cygwin's process arguments
Date: Sun, 1 Nov 2020 14:41:55 -0700	[thread overview]
Message-ID: <4fa75257-7b36-251d-16bd-bb7cb0147ad2@SystematicSw.ab.ca> (raw)
In-Reply-To: <CAFNJpngLavJyvY2krD+iO+fVffhKXy5xbpEBtruMgWdhbm3A-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]

On 2020-11-01 10:59, Oleksandr Gavenko via Cygwin wrote:
> I tried to find out what processes emacs-w32 is starting for my custom
> TRAMP method.
> 
> "strace -f emacs-w32" fails.
> 
> I expected to succeed with procmon & its filter " Command/ Process Start".
> 
> Unfortunately procmon [1] doesn't report "argv" if a Cygwin executable is
> started from a Cygwin executable. If I run a Cygwin app from the Windows
> environment it captures positional arguments.
> 
> Is there some option to make positional arguments visible to procmon?
> 
> I could find it in:
> 
> * https://cygwin.com/cygwin-ug-net/using-cygwinenv.html
> * https://cygwin.com/cygwin-ug-net/setup-env.html
> 
> Please keep my email in CC...
> 
> [1] https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

Package procps-ng /usr/bin/procps, and /proc/*/cmdline (null terminated args):

$ procps -aeflw

Suggest:

$ alias cyg-proc=/usr/bin/proc
$ alias proc=/usr/bin/procps

$ head /proc/*/cmdline | cat -A; echo

see attached logs for output.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

[-- Attachment #2: cmdline.log --]
[-- Type: text/plain, Size: 2534 bytes --]

$ head /proc/*/cmdline  | cat -A; echo
==> /proc/17834/cmdline <==$
/bin/sh^@/usr/bin/startxwin^@$
==> /proc/17934/cmdline <==$
xinit^@/etc/X11/xinit/startxwinrc^@--^@/usr/bin/XWin^@:0^@-multiwindow^@-auth^@$HOME/.serverauth.17834^@$
==> /proc/17935/cmdline <==$
/usr/bin/XWin^@:0^@-multiwindow^@-auth^@$HOME/.serverauth.17834^@$
==> /proc/17938/cmdline <==$
/usr/bin/xwin-xdg-menu^@$
==> /proc/17951/cmdline <==$
dbus-launch^@--sh-syntax^@--exit-with-session^@$
==> /proc/17952/cmdline <==$
/usr/bin/dbus-daemon^@--fork^@--print-pid^@5^@--print-address^@7^@--session^@$
==> /proc/17956/cmdline <==$
/usr/bin/gnome-keyring-daemon^@--start^@--components=pkcs11^@$
==> /proc/17964/cmdline <==$
/usr/bin/fbxkb^@$
==> /proc/17966/cmdline <==$
/usr/libexec/gam_server^@$
==> /proc/32326/cmdline <==$
ssh-agent^@$
==> /proc/34859/cmdline <==$
pcmanfm^@$
==> /proc/349/cmdline <==$
/usr/bin/mintty^@-s^@120x60^@-p^@210,120^@-^@$
==> /proc/350/cmdline <==$
-bash^@$
==> /proc/374/cmdline <==$
/usr/bin/cygrunsrv$
==> /proc/375/cmdline <==$
/usr/bin/cygrunsrv$
==> /proc/376/cmdline <==$
/usr/sbin/cygserver$
==> /proc/377/cmdline <==$
/usr/bin/cygrunsrv$
==> /proc/378/cmdline <==$
/usr/sbin/cron$
==> /proc/379/cmdline <==$
/usr/sbin/syslog-ng$
==> /proc/41273/cmdline <==$
/usr/bin/xman^@-pagesize^@600x800+1300+200^@$
==> /proc/42875/cmdline <==$
head^@/proc/17834/cmdline^@/proc/17934/cmdline^@/proc/17935/cmdline^@/proc/17938/cmdline^@/proc/17951/cmdline^@/proc/17952/cmdline^@/proc/17956/cmdline^@/proc/17964/cmdline^@/proc/17966/cmdline^@/proc/32326/cmdline^@/proc/34859/cmdline^@/proc/349/cmdline^@/proc/350/cmdline^@/proc/374/cmdline^@/proc/375/cmdline^@/proc/376/cmdline^@/proc/377/cmdline^@/proc/378/cmdline^@/proc/379/cmdline^@/proc/41273/cmdline^@/proc/42875/cmdline^@/proc/49760/cmdline^@/proc/49765/cmdline^@/proc/self/cmdline^@
==> /proc/49760/cmdline <==$
dirmngr^@--daemon^@--homedir^@$HOME/.gnupg^@$
==> /proc/49765/cmdline <==$
gpg-agent^@--homedir^@$HOME/.gnupg^@--use-standard-socket^@--daemon^@$
==> /proc/self/cmdline <==$
head^@/proc/17834/cmdline^@/proc/17934/cmdline^@/proc/17935/cmdline^@/proc/17938/cmdline^@/proc/17951/cmdline^@/proc/17952/cmdline^@/proc/17956/cmdline^@/proc/17964/cmdline^@/proc/17966/cmdline^@/proc/32326/cmdline^@/proc/34859/cmdline^@/proc/349/cmdline^@/proc/350/cmdline^@/proc/374/cmdline^@/proc/375/cmdline^@/proc/376/cmdline^@/proc/377/cmdline^@/proc/378/cmdline^@/proc/379/cmdline^@/proc/41273/cmdline^@/proc/42875/cmdline^@/proc/49760/cmdline^@/proc/49765/cmdline^@/proc/self/cmdline^@


[-- Attachment #3: procps.log --]
[-- Type: text/plain, Size: 2290 bytes --]

$ procps -aeflw
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 S $USER      350   349  0  80   0 -   140 -      Oct24 pty0     00:01:13 -bash
0 S SYSTEM     376   374  0  80   0 -     0 -      Oct13 ?        00:30:46 /usr/sbin/cygserver
0 S $USER    41273   350  0  80   0 -   231 -      Oct31 pty0     00:00:03 /usr/bin/xman -pagesize 600x800+1300+200
0 S $USER    49765     1  0  80   0 -    95 -      Oct26 ?        00:01:16 gpg-agent --homedir $HOME/.gnupg --use-standard-socket --daemon
0 S $USER    49760     1  0  80   0 -   349 -      Oct26 ?        00:00:11 dirmngr --daemon --homedir $HOME/.gnupg
0 S SYSTEM     379   377  0  80   0 -     0 -      Oct13 ?        00:00:46 /usr/sbin/syslog-ng
0 S $USER    32326     1  0  80   0 -    84 -      Oct18 ?        00:00:00 ssh-agent
0 S $USER    17938 17934  0  80   0 -   201 -      Oct13 ?        00:03:56 /usr/bin/xwin-xdg-menu
0 S $USER    34859 17938  0  80   0 -   252 -      08:39 ?        00:00:45 pcmanfm
0 S $USER    17966     1  1  80   0 -   217 -      Oct13 ?        08:46:56 /usr/libexec/gam_server
0 S $USER    17951     1  0  80   0 -    84 -      Oct13 ?        00:00:00 dbus-launch --sh-syntax --exit-with-session
0 S $USER    17935 17934  0  80   0 -  2112 -      Oct13 cons0    00:57:53 /usr/bin/XWin :0 -multiwindow -auth $HOME/.serverauth.17834
0 S $USER    17956     1  0  80   0 -   128 -      Oct13 ?        00:01:22 /usr/bin/gnome-keyring-daemon --start --components=pkcs11
0 S $USER      349     1  0  80   0 -   288 -      Oct24 ?        01:26:40 /usr/bin/mintty -s 120x60 -p 210,120 -
0 R $USER    42895   350  0  80   0 -    98 -      14:34 pty0     00:00:00 procps -aeflw
0 S $USER    17952     1  0  80   0 -    89 -      Oct13 ?        00:00:03 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
0 S $USER    17964 17938  0  80   0 -   124 -      Oct13 ?        00:00:47 /usr/bin/fbxkb
0 S $USER    17934 17834  0  80   0 -    84 -      Oct13 cons0    00:00:00 xinit /etc/X11/xinit/startxwinrc -- /usr/bin/XWin :0 -multiwindow -auth $HOME/.serverauth.17834
0 S SYSTEM     378   375  0  80   0 -     0 -      Oct13 ?        00:00:12 /usr/sbin/cron
0 S $USER    17834     1  0  80   0 -    80 -      Oct13 cons0    00:00:00 /bin/sh /usr/bin/startxwin


  reply	other threads:[~2020-11-01 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 17:59 Oleksandr Gavenko
2020-11-01 21:41 ` Brian Inglis [this message]
2020-11-01 21:48   ` Brian Inglis
2020-11-02  6:36 ` Andrey Repin
2020-11-02  9:04   ` Oleksandr Gavenko

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=4fa75257-7b36-251d-16bd-bb7cb0147ad2@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    --cc=gavenkoa@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).