You are not logged in.

#1 2012-06-26 03:04:21

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Using perf stat on command with ssh piping?

Does anyone familiar with perf tools in kernel?
https://perf.wiki.kernel.org/index.php/Tutorial

I want to use perf stat to get hardware events data from a command that sends data from home to a remote device.
For example:

cat file > ssh user@ipaddress "cat > newlocation/file"
perf stat cat file > ssh user@ipaddress "cat > newlocation/file"

Do you know how can I ensure that perf tools will record hardware event data during delays (over networks)... What I am worried is that perf will only measure upto pipe symbol and ignore anything else (I had this esperiance with /usr/bin/time (after which I switched to use shell time).

I could not find any information on how perf stat is working when there is a pipe in the middle of that command it will measure.

Would it be better to put command below into a sh file and then call perf stat command.sh?

cat file > ssh user@ipaddress "cat > newlocation/file"

Last edited by kdar (2012-06-26 03:22:05)

Offline

#2 2012-06-26 06:16:51

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: Using perf stat on command with ssh piping?

I always think of ncat for these sort of things
http://nmap.org/ncat/guide/index.html
you can also use scp to copy files between comps

scp /path/to/local/file user@ipaddress:/path/to/file/on/server

scp would be better than cat file > ssh
afaik

HTH


You're just jealous because the voices only talk to me.

Offline

#3 2012-06-26 12:41:40

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Using perf stat on command with ssh piping?

scp is using ssh? right?

You think it would be similar in performance of cat file > ssh?

Offline

#4 2012-06-26 13:12:01

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Using perf stat on command with ssh piping?

If you want to use ssh instead of scp, you need to redirect the file, not try to redirect stdout to a command...

ssh user@host 'cat >remotefile' <localfile

Offline

#5 2012-06-26 14:40:13

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Using perf stat on command with ssh piping?

The other command that I trying to use is actually using compression over network..
like gzip -fc file | ssh user@host "cat > /dev/null"

I guess its a better example that what I posted on the first post.... using cat

@falconindy
I could convert  gzip -fc file | ssh user@host "cat > /dev/null" similar to your example without using a pipe too?
ssh user@host 'cat > /dev/null' < gzip -fc file  ? or it would not work?

====
Would putting a command into cmd.sh file create overhead? (of reading a file.. etc)

Last edited by kdar (2012-06-26 15:20:59)

Offline

Board footer

Powered by FluxBB