how the data from disk is loaded into memory and then it supplied to tcp/ip packet.
how i can trace the no of pages loaded in memory by that process and rate of context switch for that process.
Try
/usr/bin/time -v command
With GNU coreutils, this outputs:
Command exited with non-zero status 1
Command being timed: "test"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.01
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 0
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1
Minor (reclaiming a frame) page faults: 120
Voluntary context switches: 3
Involuntary context switches: 1
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 1
Careful not to use just "time", because this might be a shell builtin.
If you need tracing whilst the command is doing its thing, you can use the ps command. The options for that are very much OS specific.