[Lldb-commits] [PATCH 1/2] Removed use of NSEC_PER_SEC.
Stephen Wilson
wilsons at start.ca
Thu Apr 7 03:40:05 PDT 2011
On Thu, Apr 07, 2011 at 07:56:50AM +0200, Marco Minutoli wrote:
> No I don't have commit access. So please do it for me.
Commited in r129071.
Marco, there are still a few more build issues but they all look pretty
simple at this point. The only thing left is to add makefile support
for the ARM emulation plugin. I can find the time to fix up the
remaining issues today.
Thanks!
>
> Thank you.
> Marco
>
> On Thu, Apr 7, 2011 at 12:12 AM, Greg Clayton <gclayton at apple.com> wrote:
>
> > Looks good. Marco, do you have commit access? If so, commit when you get
> > the chance. Else I will do so on your behalf.
> >
> > Greg Clayton
> >
> > On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote:
> >
> > > NSEC_PER_SEC is not defined in sys/time.h on Linux. I have replaced
> > > that macro with a static constant inside TimeValue.
> > > ---
> > > include/lldb/Host/TimeValue.h | 2 ++
> > > .../gdb-remote/GDBRemoteCommunicationClient.cpp | 12 ++++++------
> > > 2 files changed, 8 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/include/lldb/Host/TimeValue.h
> > b/include/lldb/Host/TimeValue.h
> > > index 81d1aed..04b6015 100644
> > > --- a/include/lldb/Host/TimeValue.h
> > > +++ b/include/lldb/Host/TimeValue.h
> > > @@ -29,6 +29,8 @@ namespace lldb_private {
> > > class TimeValue
> > > {
> > > public:
> > > + static const uint32_t NanoSecondPerSecond = 1000000000U;
> > > +
> > > //------------------------------------------------------------------
> > > // Constructors and Destructors
> > > //------------------------------------------------------------------
> > > diff --git
> > a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> > b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> > > index d0198a0..7ad3d44 100644
> > > --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> > > +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> > > @@ -1385,13 +1385,13 @@ GDBRemoteCommunicationClient::TestPacketSpeed
> > (const uint32_t num_packets)
> > > }
> > > end_time = TimeValue::Now();
> > > total_time_nsec =
> > end_time.GetAsNanoSecondsSinceJan1_1970() -
> > start_time.GetAsNanoSecondsSinceJan1_1970();
> > > - packets_per_second =
> > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC;
> > > + packets_per_second =
> > (((float)num_packets)/(float)total_time_nsec) *
> > (float)TimeValue::NanoSecondPerSecond;
> > > printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in
> > %llu.%09.9llu sec for %f packets/sec.\n",
> > > num_packets,
> > > send_size,
> > > recv_size,
> > > - total_time_nsec / NSEC_PER_SEC,
> > > - total_time_nsec % NSEC_PER_SEC,
> > > + total_time_nsec /
> > TimeValue::NanoSecondPerSecond,
> > > + total_time_nsec %
> > TimeValue::NanoSecondPerSecond,
> > > packets_per_second);
> > > if (recv_size == 0)
> > > recv_size = 32;
> > > @@ -1409,11 +1409,11 @@ GDBRemoteCommunicationClient::TestPacketSpeed
> > (const uint32_t num_packets)
> > > }
> > > end_time = TimeValue::Now();
> > > total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() -
> > start_time.GetAsNanoSecondsSinceJan1_1970();
> > > - packets_per_second =
> > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC;
> > > + packets_per_second =
> > (((float)num_packets)/(float)total_time_nsec) *
> > (float)TimeValue::NanoSecondPerSecond;
> > > printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f
> > packets/sec.\n",
> > > num_packets,
> > > - total_time_nsec / NSEC_PER_SEC,
> > > - total_time_nsec % NSEC_PER_SEC,
> > > + total_time_nsec / TimeValue::NanoSecondPerSecond,
> > > + total_time_nsec % TimeValue::NanoSecondPerSecond,
> > > packets_per_second);
> > > }
> > > }
> > > --
> > > 1.7.1
> > >
> > > _______________________________________________
> > > lldb-commits mailing list
> > > lldb-commits at cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
> >
> >
>
>
> --
> Marco Minutoli
>
> "If A is success in life, then A equals x plus y plus z. Work is x;
> y is play; and z is keeping your mouth shut." --A. Einstein
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
--
steve
More information about the lldb-commits
mailing list