title: Extract TCP round trip time (RTT) estimations on linux
body: <p>I have apache server running on Ubuntu. Client connects and downloads an image. I need to extract RTT estimations for the underlying TCP connection. Is there a way to do this? Maybe something like running my tcp stack in debug mode to have it log this info somewhere?</p>
  
  <p>Note that I don't want to run tcpdump and extract RTTs from the recorded trace! I need the TCP stack's RTT estimations (apparently this is part of the info you can get with TCP_INFO socket option). Basically need something like tcpprob (kprobe) to insert a hook and record the estimated RTT of the TCP connection on every incoming packet (or on every change).</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I found a solution. rtt, congestion window and more can be logged using tcpprobe. I posted an answer below.</p>