Date start of a process - Aix

This is a discussion on Date start of a process - Aix ; Hi, How can I see the date/time of a process when this is > 24 Hours Thanks in advance...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Date start of a process

  1. Date start of a process

    Hi,

    How can I see the date/time of a process
    when this is > 24 Hours

    Thanks in advance



  2. Re: Date start of a process

    astalavista schrieb:
    > Hi,
    >
    > How can I see the date/time of a process
    > when this is > 24 Hours
    >

    I don't have an AIX system to check/provide full details
    right now. But in kdb you can get the start time (int
    value, seconds since 1.1.1970 0:00).
    If on 5.3 or later:
    - get the pid (ps or....)
    - kdb
    * tpid -d
    This displays the thread(s) data for your pid
    I think the start time is in the ublock. Get the
    thread slot from the thread display
    * u
    and search.
    On 5.2 or older tpid does not have -d flag, here
    you need to convert the decimal pid into a hex
    number (kdb subcommands dcal/hcal are useful here).

    If you are'n successful come back. I'll get a
    better description.

  3. Re: Date start of a process

    Thomas Braunbeck schrieb:
    > astalavista schrieb:
    >> Hi,
    >>
    >> How can I see the date/time of a process
    >> when this is > 24 Hours
    >>


    UID PID PPID C STIME TTY TIME CMD
    root 143466 155778 0 Jul 28 - 0:00 /usr/sbin/inetd

    # kdb
    (0)> tpid -d 143466
    SLOT NAME STATE TID PRI RQ CPUID CL WCHAN

    pvthread+004200 66 inetd SLEEP 04209B 03C 0 0
    (0) u 66

    Accounting and profiling data:
    start..00000000488D48B6 ticks..0000000000000BA5
    acflag......0002

    (0) q
    $ stime 488D48B6
    Start time was: Mon Jul 28 06:19:02 2008
    $ type stime
    stime is /home/fuzzy/bin/stime
    $ cat ../lib/stime.c
    #include
    #include
    #include
    #include

    main(argc, argv, envp)
    int argc;
    char **argv;
    char **envp;
    {
    unsigned long clock;
    if (argc != 2) {
    fprintf(stderr, "usage: %s time_t as hex value\n", argv[0]);
    exit (1);
    } /* endif */
    sscanf (argv[1], "%x", &clock);
    fprintf(stdout, "Start time was: %s\n", ctime(&clock));
    }

  4. Re: Date start of a process

    OK thanks

    "Thomas Braunbeck" a écrit dans le message de
    news: 48900695$0$886$ba4acef3@news.orange.fr...
    > Thomas Braunbeck schrieb:
    >> astalavista schrieb:
    >>> Hi,
    >>>
    >>> How can I see the date/time of a process
    >>> when this is > 24 Hours
    >>>

    >
    > UID PID PPID C STIME TTY TIME CMD
    > root 143466 155778 0 Jul 28 - 0:00 /usr/sbin/inetd
    >
    > # kdb
    > (0)> tpid -d 143466
    > SLOT NAME STATE TID PRI RQ CPUID CL WCHAN
    >
    > pvthread+004200 66 inetd SLEEP 04209B 03C 0 0
    > (0) u 66
    >
    > Accounting and profiling data:
    > start..00000000488D48B6 ticks..0000000000000BA5
    > acflag......0002
    >
    > (0) q
    > $ stime 488D48B6
    > Start time was: Mon Jul 28 06:19:02 2008
    > $ type stime
    > stime is /home/fuzzy/bin/stime
    > $ cat ../lib/stime.c
    > #include
    > #include
    > #include
    > #include
    >
    > main(argc, argv, envp)
    > int argc;
    > char **argv;
    > char **envp;
    > {
    > unsigned long clock;
    > if (argc != 2) {
    > fprintf(stderr, "usage: %s time_t as hex value\n", argv[0]);
    > exit (1);
    > } /* endif */
    > sscanf (argv[1], "%x", &clock);
    > fprintf(stdout, "Start time was: %s\n", ctime(&clock));
    > }




+ Reply to Thread