Changeset 212faa13


Ignore:
Timestamp:
07/02/13 16:03:37 (7 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
c04929c
Parents:
ee2ea572
Message:
  • It turns out the return value of erf_get_timestamp is always going to be in host byte order, so we don't need a special code path for big endian machines at all!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r11041eb r212faa13  
    922922                /* timestamp -> timeval */
    923923                ts = packet->trace->format->get_erf_timestamp(packet);
    924 #if __BYTE_ORDER == __BIG_ENDIAN
    925                 tv.tv_sec = ts & 0xFFFFFFFF;
    926                 tv.tv_usec = ((ts >> 32) * 1000000) & 0xFFFFFFFF;
    927 #elif __BYTE_ORDER == __LITTLE_ENDIAN
    928924                tv.tv_sec = ts >> 32;
    929925                tv.tv_usec = ((ts&0xFFFFFFFF)*1000000)>>32;
    930 #else
    931 #error "What on earth are you running this on?"
    932 #endif
    933926                if (tv.tv_usec >= 1000000) {
    934927                        tv.tv_usec -= 1000000;
     
    961954                /* timestamp -> timeval */
    962955                uint64_t erfts = packet->trace->format->get_erf_timestamp(packet);
    963 #if __BYTE_ORDER == __BIG_ENDIAN
    964                 ts.tv_sec = erfts & 0xFFFFFFFF;
    965                 tv.tv_nsec = ((ts >> 32) * 1000000000) & 0xFFFFFFFF;
    966 #elif __BYTE_ORDER == __LITTLE_ENDIAN
    967956                ts.tv_sec = erfts >> 32;
    968957                ts.tv_nsec = ((erfts&0xFFFFFFFF)*1000000000)>>32;
    969 #else
    970 #error "What on earth are you running this on?"
    971 #endif
    972958                if (ts.tv_nsec >= 1000000000) {
    973959                        ts.tv_nsec -= 1000000000;
Note: See TracChangeset for help on using the changeset viewer.