Sponsored Content
Full Discussion: Question about WCHAN values
Top Forums UNIX for Beginners Questions & Answers Question about WCHAN values Post 303044500 by bodisha on Monday 24th of February 2020 11:08:24 AM
Old 02-24-2020
Question about WCHAN values

I have a CentOS 8 (3.10) running on VirtualBox 6.0... And I have 2 questions about WCHAN

The 'ps' man page describes WCHAN as:

Quote:
nwchan WCHAN address of the kernel function where the process
is sleeping (use wchan if you want the kernel
function name). Running tasks will display a
dash ('-') in this column.

wchan WCHAN name of the kernel function in which the process
is sleeping, a "-" if the process is running, or
a "*" if the process is multi-threaded and ps is
not displaying threads.

I haven't see the "*" yet, but I'll see a "?" in the output of the "ps" command with regularity. Usually associated with the rcu_sched kernel process, but the "?" does appear for other processes. I haven't found a definition for the "?"... What does it mean?

My 2nd question is about a discrepancy I'm seeing between the output of the 'ps' command and the 'System Monitor' GUI utility. Under the 'ps' command, I'll see several processes in a run state and will have a "-" under WCHAN. Yet under the "System Monitor", those same processes will be in a run state with a WCHAN code of "poll_schedule_timeout". From what I've read this indicates a process is waiting for I/O... Shouldn't these processes be in a sleep state?

Image

Last edited by bodisha; 02-24-2020 at 01:45 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed question - replacing param values

Hello, Do you have any idea why the below sed command is also replacing the value of "PARAMETER2" instead of just "PARAMETER" in file1 ? % parameter=PARAMETER % new_value=2 % cat file1 PARAMETER=1 PARAMETER2=1 % cat file1 | sed s/*$/${new_value}/1 PARAMETER=2 PARAMETER2=2 Thanks. (3 Replies)
Discussion started by: majormark
3 Replies

2. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

3. UNIX for Advanced & Expert Users

Capture child processes and change return values question

Thanks in advance. My environment is Ubuntu 9.04 desktop customized to be a high school classroom server for teaching code development. I have a unique "fake" jail called "lshell" which is very easy to setup and restricts users to commands that I dictate DISALLOWING ANYTHING ELSE. These... (6 Replies)
Discussion started by: tuxhats
6 Replies

4. UNIX for Dummies Questions & Answers

Process stopped: WCHAN pipe_w

Hi. Before throwing my question, thanks to everybody for paying attention. Sorry if my english isn't good enough, but it's not my mother tongue. That's my question: I have a java program that throws an external program with "Process p = Runtime.getRuntime.exec(***)". The communication between... (2 Replies)
Discussion started by: jlopezperez
2 Replies

5. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

6. Shell Programming and Scripting

Converting odd values to even values(or vice-versa) located in a column

Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

8. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

9. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

10. UNIX for Dummies Questions & Answers

Default values for positional parameters - dummy question I think

Hi, Sorry for a dummy question I believe. I am just wanting to know how do I assign a default $1 argument if one is not provided. At the moment, I am doing something like below: arg1="${1:-foo}"And then I check $arg1 in case/esac. I am just wondering if there is a way for me to simply do... (3 Replies)
Discussion started by: newbie_01
3 Replies
PS(1)								Linux User's Manual							     PS(1)

NAME
ps - report process status SYNOPSIS
ps [lujsvmaxScewhrnu] [txx] [O[+|-]k1[[+|-]k2...]] [pids] there are also three long options: --sortX[+|-]key[,[+|-]key[,...]] --help --version More long options are on the way... DESCRIPTION
ps gives a snapshot of the current processes. If you want a repetitive update of this status, use top. This man page documents the /proc- based version of ps, or tries to. COMMAND-LINE OPTIONS The command-line options for this version of ps are derived from the BSD version of ps, not the System V version. The command-line arguments should not be preceeded by a `-' character, because in the future, a `-' will be used to indicate Unix98-stan- dard command-line arguments, while no `-' will indicate the current ``extended BSD'' style of command line arguments. For now, ps will give you a warning if you use a `-' for a short option, but it will still work. If you have shell scripts which use BSD- style arguments to ps, take heed of the warning and fix them, or else your scripts will fail to function correctly at some point in the future. If you want to turn off the warnings, set the I_WANT_A_BROKEN_PS environment variable. There are also some ``long options'' in GNU style; see below for those. l long format u user format: gives user name and start time j jobs format: pgid sid s signal format v vm format m displays memory info (combine with p flag to get number of pages). f "forest" family tree format for command line a show processes of other users too x show processes without controlling terminal S add child cpu time and page faults c command name from task_struct e show environment after command line and ` + ' w wide output: don't truncate command lines to fit on one line. To be exact, every w that is specified will add another possible line to the output. If the space isn't needed it isn't used. You may up to 100 w's. h no header r running procs only n numeric output for USER and WCHAN. txx only procs with controlling tty xx; for xx you may use either the name of a device file under "/dev" or that name with either tty or cu sliced off. This is the reverse heuristic that ps uses to print out the abbreviated tty name in the TT field, e.g. ps t1. O[+|-]k1[,[+|-]k2[,...]] Order the process listing according to the multi-level sort specified by the sequence of short keys from SORT KEYS, k1, k2, ... Default order specifications exist for each of the various formats of ps. These are over-ridden by a user specified ordering. The `+' is quite optional, merely re-iterating the default direction on a key. `-' reverses direction only on the key it precedes. As with t and pids, the O option must be the last option in a single command argument, but specifications in successive arguments are catenated. pids List only the specified processes; they are comma-delimited. The list must be given immediately after the last option in a single command-line argument, with no intervening space, e.g. ps j1,4,5. Lists specified in subsequent arguments are catenated, e.g. ps l 1,2 3,4 5 6 will list all of the processes 1-6 in long format. If pids are given, they are listed no matter what. If a tty is given matching processes are listed no matter what. These two features override the 'a' and 'x' flags. LONG COMMAND-LINE OPTIONS These options are preceeded by a double-hyphen. --sortX[+|-]key[,[+|-]key[,...]] Choose a multi-letter key from the SORT KEYS section. X may be any convenient separator character. To be GNU-ish use `='. The `+' is really optional since default direction is increasing numerical or lexicographic order. E.g.: ps jax --sort=uid,-ppid,+pid --help Get a help message that summarizes the usage and gives a list of supported sort keys. This list may be more up to date than this man page. --version Display version and source of this program. SORT KEYS
Note that the values used in sorting are the internal values ps uses and not the `cooked' values used in some of the output format fields. If someone wants to volunteer to write special comparison functions for the cooked values, ... ;-) SHORT LONG DESCRIPTION c cmd simple name of executable C cmdline full command line f flags flags as in long format F field g pgrp process group ID G tpgid controlling tty process group ID j cutime cumulative user time J cstime cumulative system time k utime user time K stime system time m min_flt number of minor page faults M maj_flt number of major page faults n cmin_flt cumulative minor page faults N cmaj_flt cumulative major page faults o session session ID p pid process ID P ppid parent process ID r rss resident set size R resident resident pages s size memory size in kilobytes S share amount of shared pages t tty the minor device number of tty T start_time time process was started U uid user ID number u user user name v vsize total VM size in bytes y priority kernel scheduling priority FIELD DESCRIPTIONS
PRI This is the counter field in the task struct. It is the time in HZ of the process's possible timeslice. NI Standard unix nice value; a positive value means less cpu time. SIZE Virtual image size; size of text+data+stack. RSS Resident set size; kilobytes of program in memory. WCHAN Name of the kernel function where the process is sleeping, with the `sys_' stripped from the function name. If /etc/psdatabase does not exist, it is just a hex number instead. STAT Information about the status of the process. The first field is R for runnable, S for sleeping, D for uninterruptible sleep, T for stopped or traced, or Z for a zombie process. The second field contains W if the process has no resident pages. The third field is N if the process has a positive nice value (NI field). TT Controlling tty. PAGEIN Number of major page faults (page faults that cause pages to be read from disk, including pages read from the buffer cache). TRS Text resident size. SWAP Kilobytes (or pages if p is used) on swap device. SHARE Shared memory. UPDATING
This proc-based ps works by reading the files in the proc filesystem, mounted on /proc. This ps does not need to be suid kmem or have any privileges to run. Do not give this ps any special permissions. You will need to put in place the appropriate System.map file when you install a new kernel in order to get meaningful information from the WCHAN field. This should be done every time you compile a new kernel. You should also run 'ps' as root once and then any time the tty devices in the "/dev" directory change. As of procps-1.00, ps/top read System.map directly if it is available. The search path for kernel address-to-symbol resolution is: $PS_SYSTEM_MAP /boot/System.map-`uname -r` /boot/System.map /lib/modules/`uname -r`/System.map /etc/psdatabase /boot/psdatabase-`uname -r` /boot/psdatabase, /lib/modules/`uname -r`/psdatabase NOTES
The member used_math of task_struct is not shown, since crt0.s checks to see if math is present. This causes the math flag to be set for all processes, and so it is worthless. Programs swapped out to disk will be shown without command line arguments, and unless the c option is given, in parentheses. %CPU shows the cputime/realtime percentage. It will not add up to 100% unless you are lucky. It is time used divided by the time the process has been running. The SIZE and RSS fields don't count the page tables and the task_struct of a proc; this is at least 12k of memory that is always resident. SIZE is the virtual size of the proc (code+data+stack). AUTHOR
ps was originally written by Branko Lankester <lankeste@fwi.uva.nl>. Michael K. Johnson <johnsonm@redhat.com> re-wrote it significantly to use the proc filesystem, changing a few things in the process. Michael Shields <mjshield@nyx.cs.du.edu> added the pid-list feature. Charles Blake <cblake@bbn.com> added multi-level sorting, the dirent-style library, the device name-to-number mmaped database, the approxi- mate binary search directly on System.map, and many code and documentation cleanups. David Mossberger-Tang wrote the generic BFD support for psupdate. Michael K. Johnson <johnsonm@redhat.com> is the current maintainer. Please send bug reports to <procps-list@redhat.com> Cohesive Systems 3 Sep 1997 PS(1)
All times are GMT -4. The time now is 06:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy