Tracing what is happening in the connect() system call

I've been playing around with some of the recipies in dtrace today trying to find out why it takes so long to connect from a linux machine to an ultra 5 running sendmail but I'm not having a lot of luck.
The one thing I can find is that the amount of time for the connect system call to return takes a long time. Here's the dtrace script I wrote (borrowing from Bryan Cantrill's blog):
bash-2.05b# cat functiontime.d
#!/usr/sbin/dtrace -s
#pragma D option flowindent
syscall::connect:entry
/execname == "sendmail"/
self->start = vtimestamp;
syscall:::entry,
syscall:::return
/self->start/
trace(vtimestamp - self->start);
syscall::connect:return
/execname == "sendmail"/
self->start = 0;
exit(0);
This is the output:
bash-2.05b# ./functiontime.d
dtrace: script './functiontime.d' matched 454 probes
CPU FUNCTION
0 => connect 0
0 | connect:return 303079
0 <= connect
I know there are other syscalls going on from the time connect enters to the time it returns but I have no idea how to get them to print.
Any ideas how I can make this script more useful to see exactly where sendmail is getting hung up?

You might also try something like
#!/usr/sbin/dtrace -s
#pragma D option flowindent
syscall::connect:entry
/execname == "sendmail"/
        self->depth = 1;
        self->syscallstart = timestamp
fbt:::entry
/self->depth/
        self->start[self->depth] = timestamp;
        trace(self->start[self->depth++] - self->syscallstart);
fbt:::return
/self->depth/
        this->delta = timestamp - self->start[--self->depth];
        @func[probefunc] = quantize(this->delta);
        printf("delta is %d\n", this->delta);
        self->start[self->depth] = 0;
syscall::connect:return
/self->depth/
        exit(0);
}This will give you the function call flow inside the kernel along with the following:
- on function entry, a time delta since connect was called
- on function exit, how long we spent in the function
- on return from the connect system call, a list of histograms showing the call times for all functions called
You are probably going to want to redirect the output as it gets big.
Also note, I've written this to give the information only for the first call to connect.
Alan.
Alan Hargreaves - http://blogs.sun.com/tpenta
Senior Technical Support Specialist/VOSJEC Engineer
Product Technical Support (APAC)
Sun Microsystems

Similar Messages

  • What will happen to the stuff in my keychain after today? I don't want iCloud. Can I keep the keychain? in my system?

    what will happen to the stuff in my keychain after today? I don't want iCloud. Can I keep the keychain in my system under lion? Can someone please help me?

    Thank you Sig. Well I keep all my passwords in my keychain. I'm concerned I'll lose them after today. I understand that keychain will be obsolete after today. I don't want icloud either, because I don't want all my personal info on a server. I want to keep my personal information in my system. Am I making any sense? Can you make any suggestions or offer any insights around this? 

  • When we do a failover to a Replica, what happened to the connected clients? Assuming that the Replica is located in a remote DR site with a different IP configuration.

    When we do a failover to a Replica, what happened to the connected clients? Assuming that the Replica is located in a remote DR site with a different IP configuration.
    Hi,
    I need some guidance here, please.
    I have some questions about replication:
    When we do a failover to a Replica, what happened to the connected clients? Assuming that the Replica is located in a remote DR site with a different IP configuration.
    Is possible to automate the failover process? Just like happens in a cluster.
    What changes do I need to do in order to guarantee that my clients reach my replica? For example, I need to do a failover to my Exchange Server Replica and I need to minimize the downtime. The same applies for a DC or a SharePoint Server
      Thanks in advanced.

    Hi efebo,
    “The same applies for a DC ”
    As for replicating virtualized DC (Personally,  I do not suggest to replicate DC , even though it can be replicate ), please refer to following link:
    http://technet.microsoft.com/en-us/library/dn250021.aspx
     "In short, Exchange does
    not support the Hyper-V Replica feature.  Exchange has a long history of supporting virtualisation from
    Exchange 2003 onwards.  It is fully supported to install Exchange
    2007,
    2010 or
    2013 as a virtual machine on Hyper-V, but using the Hyper-V replica feature is not supported.
    For details please refer to following link:
    http://blogs.technet.com/b/rmilne/archive/2013/07/29/exchange-and-hyper-v-replica-support.aspx
    I assuming that the "Remote DR site" and the primary site both have public IPs .
    Based on my knowledge  you can not access replica site VM  directly after a disaster , maybe you need to rebuild primary site and replicate VM back .
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • MY PC WAS REFORMATTED. WHAT WILL HAPPEN WHEN I CONNECT MY IPOD TO MY PC NOW

    Hi everyone!
    My pc was recently formatted, and now I want to add new songs to my iPod. What will happen to the songs in my iPod when i connect it to the newly formatted PC? (not all songs in my iPod are in my PC anymore).
    Is there a way I can get all my songs from my iPod to my PC? If there is a way, would the songs remain organized from the iPod to the PC? Coz I am very organized with my iTunes and iPod, every artist, genre, album title is fixed.
    Would the PC automatically update my iPod? I know there is a setting in iTunes where I could choose if iTunes updates my iPod automatically or manually, but I can't seem to find it. I'm afraid to connect my iPod now to my PC because this might erase and foul up my songs in my iPod.
    Thanks and please help.
    Chad

    If your iPod is set to update automatically you just need to take care when connecting back to your computer and an empty iTunes. If it is set to automatically update you will get a message that your iPod is linked to a different library and asking if you want to link to this one and replace all your songs etc, press *No*. Pressing "Yes" will irretrievably remove all songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it: Managing Your Songs Manually
    You can also use a keyboard command to prevent your iPod auto-syncing with iTunes. While connecting the iPod to the computer on Windows hold down the Shift + Ctrl keys (on a Mac hold down the Option and Command (⌥ and ⌘) keys). This will stop the iPod from auto-syncing with iTunes and the iPod will appear in the source list. Wait until you are sure the iPod has mounted, and that it will not auto sync and then you can let the keys go. This may take between 20 to 30 seconds depending on your computer. Then go to Edit>Preferences>iPod and check the "Manually manage songs and playlists" box.
    You can't sync or drag your music back directly from an iPod to iTunes, the transfer of music is designed by default to be one way from iTunes to iPod. However there is a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows posted in this thread: MacMuse - iPod to iTunes
    If you prefer something more automated then there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod, this is just a selection. Have a look at the web pages and documentation for these, they are generally quite straightforward.
    YamiPod Mac and Windows Versions
    iGadget Windows Only
    iPodCopy Mac and Windows Versions
    iPod Access Mac and Windows Versions
    PodUtil Mac and Windows Versions
    iPodCopy Mac and Windows Versions
    PodPlayer Windows Only
    Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync again. I would also advise that you get yourself an external hard drive and back your stuff up in case you have problems again. External drives are comparatively inexpensive these days and you can get loads of storage for quite a small outlay.

  • What would happen if you connected audio out to audio in?

    the audio in/out ports on the back -- what would happen if you connected them? if i were, say, playing a youtube video and had an audio editing app open, would it record the audio? (yes, i'm aware that there are better ways to capture said audio but i'm just wondering if this is what would happen.) or would the computer explode?
    Message was edited by: MontereyMatt

    There should not be any problem with doing that. The audio output is just regular output, so it would be the same as plugging in an iPod to the audio input.
    But as you said, there are better ways to record the audio the iMac is currently playing.

  • What is happening in the most recent keynote when I click on a slide and it pulses (larger-smaller)  Two of my slides have disappeared in the navigator although if I play through them they are there.

    What is happening in the most recent keynote when I click on a slide and it pulses (larger-smaller)  Two of my slides have disappeared in the navigator although if I play through them they are there and the slides have their orignal number--there are just white spaces where the slide should be and I can only get to the slide by clicking through from the prior slide.  How do I get the sldies back into the navigator so I can see them.  Oddly, they are show up just find on the light table. 

    Try removing any transitions or builds on these slides, or delete the slides then recreate them as fresh slides.
    There are many playback anomalies in Keynote 6 which Apple have said they will be  sorting out next year.

  • What will happened in the excise while we sent free goods @ samples

    what will happened in the excise while we sent free goods @ samples

    Dear maha,
    What ever the Transactions(Except Exports)..you have to pay the Excise duty and Cess.
    Regards
    Luckky

  • What will happen to " the new iPad " I bought 2 months ego. Now the model is discontinued . What apple will do?....really disappointing.

    What will happen to " the new iPad " I bought 2 months ego. Now the model is discontinued . What apple will do?....really disappointing.

    I just bought two new iPads a few weeks ago. If they're still in the return window they're going back. Maybe it's time to look at some of the Android tablets since all of a sudden Apple thinks the mini is a great idea.

  • What has happened to the iPad 2 finger select and drag technique? Since upgrading to iOS7 it does not work? I used this all the time to select multple images, approx 75  from an SD card containing 1000  images. Its painful indvidually selecting the images

    What has happened to the iPad 2 finger select and drag technique?
    Since upgrading to iOS7 it does not work?
    I used this all the time to select multple images, approx 75  from an SD card containing 1000  images. Its painful indvidually selecting the images

    What would you like us to tell you? If it doesn't work, there is nothing that we users can do about it.
    Please submit your feature request to Apple at this link: http://www.apple.com/feedback

  • If I take my bank card details off my itunes account and opened a new itunes account what would happen to the old account?

    If I take my bank card details off my itunes account and opened a new itunes account what would happen to the old account?

    you're more likely to get quick and accurate answers to an iTunes question in the iTunes forum, this is the GarageBand forum

  • If I take my bank card details off my itunes account and open a new itunes account what will happen to the old account?

    If I take my bank card details off my itunes account and open a new itunes account what will happen to the old account?

    you're more likely to get quick and accurate answers to an iTunes question in the iTunes forum, this is the GarageBand forum

  • What is happen when the screen goes white

    what is happen when the ipod screen is going blank

    what is happen when the ipod screen is going blank

  • What will happen to the data I´ve in my Key ring when migrating to iCloud

    What will happen to the data I´ve in my Key ring when migrating to iCloud?
    Any feedback is appreciated
    Uwe

    Hi Winston!
    Thanks for your quick response. I meant keychain items. So I you anserwed my question, perfectly.
    Best
    Uwe

  • What is happening to the pictures sent with text messages?

    What is happening to the pictures sent with text messages?

    We don't know unless you give us a little more detail as to what the problem is.

  • What has happened to the wonderful, independent,  DTP section of Pages?

    What has happened to the wonderful, separate, Desk Top Publishing section of Pages?
    Since upgrading, I am no longer able to:
    See my column markers when  layout view is enabled
    I cannot identify the colours I regularly use in my magazine layouts as those colours are no longer shown on the palette
    I cannot find the flow buttons that used to exist in the bottom right hand corner of the text boxes and can no longer get text flowing from one page to another.
    I work in collaboration with someone else in magazine production and we need to be able to liaise with regard to the formatting.   this is now very difficult.   I need this sorted ASAP as we are working to a deadline.

    Go back to Pages '09:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&mforum=iworktips ntrick
    For a full list of the Additions/removals and changes in Pages 5:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Review/rate Pages 5 in the App Store.
    Peter

Maybe you are looking for

  • Pricing Procedure Requirment

    Dear guru's,                 my client requirment is as follows.                we have Two materials one is Service and other is Trading Material.Here service material is not collected any VAT Tax. Where as Trading Material needs to calculate VAT Ta

  • Adobe Builder 4.7 Serial Number does not work

    Hi, I followed the instructions to download and install the Adobe Builder 4.7 Beta @ http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_flashbuilder4-7. The Serial Number mentioned for the product (1424-4002-6183-5974-1150-0356) does not work

  • Customer Outstanding line item reversal

    Hi Experts... As per Clients requirement we developed a report for customer Outstanding Payments.  Which will displays the customers bills sequential.  When ever they receive money post the transactions as per Outstanding bill wise. Now my problem is

  • My ipad froze with my camera screen on and my background on full screen?  If I press any button it takes a picture

    my ipad froze with my camera screen on and my background on full screen.  Every button I push on it takes a pic.  won't shut off either, it takes a pic instead

  • Error in creating oracle module

    hi, I work with oracle warehouse builder 10g and my database is 10g too. I try to create oracle module. in the last step I made new location and click finish. I recieve following error : Internal Error :SQL Exception.Please contact Oracle Support wit