lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: "Mousa, Anas via lttng-dev" <lttng-dev@lists.lttng.org>
To: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: [lttng-dev] Profiling LTTng tracepoint latency on different arm platforms
Date: Tue, 20 Jun 2023 10:27:09 +0000	[thread overview]
Message-ID: <6e06b605ec9f446da5dc8948c8621518@amazon.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2638 bytes --]

Hello,



I've recently profiled the latency of LTTng tracepoints on arm platforms,

using the follow sample program:



----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

static inline uint64_t get_time_nsec(void)

{

        struct timespec ts;



        if (caa_unlikely(clock_gettime(CLOCK_MONOTONIC, &ts))) {

                ts.tv_sec = 0;

                ts.tv_nsec = 0;

        }

        return ((uint64_t) ts.tv_sec * 1000000000ULL) + ts.tv_nsec;

}






int main(int argc, char *argv[])

{

    unsigned int i;

    int tp_num = 0;

    uint64_t total_time = 0;

    uint64_t now, nowz;



    if (argc > 1) {

        sscanf (argv[1],"%d",&tp_num);

    }

    for (i = 0; i < tp_num; i++) {

        now = get_time_nsec();

        lttng_ust_tracepoint(hello_world, my_first_tracepoint,

                             i, "some_str");

        nowz = get_time_nsec();

        total_time += (nowz - now);

    }



    if (tp_num) {

        printf("---------------------------Average TP time is %"PRIu64"---------------------------\n", total_time / tp_num);

    }

}

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------






I observed a big average latency variance on different platforms when tracing a high number (many thousands to millions) of tracepoints:



  *   [platform 1] with CPU info running a linux kernel based on Buildroot (4.19.273 aarch64 GNU/Linux):



BogoMIPS        : 187.50

Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

CPU implementer   : 0x41

CPU architecture: 8

CPU variant       : 0x0

CPU part  : 0xd08

CPU revision      : 3



     *    Saw an average latency of 2-3usec


  *   [platform 2] with CPU info running a linux kernel based on Amazon Linux (4.14.294-220.533.amzn2.aarch64 aarch64 GNU/Linux):



BogoMIPS        : 243.75

Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs

CPU implementer   : 0x41

CPU architecture: 8

CPU variant       : 0x3

CPU part  : 0xd0c

CPU revision      : 1



     *   Saw an average latency of ~0.5usec







Are there any suggestions to root cause the high latency and potentially improve it on platform 1?



Thanks and best regards,

Anas.


[-- Attachment #1.2: Type: text/html, Size: 102791 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

             reply	other threads:[~2023-06-20 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 10:27 Mousa, Anas via lttng-dev [this message]
2023-06-20 14:20 ` [lttng-dev] Profiling LTTng tracepoint latency on different arm platforms Mathieu Desnoyers via lttng-dev
2023-06-20 18:03   ` Mathieu Desnoyers via lttng-dev
2023-06-21  5:39     ` Yitschak, Yehuda via lttng-dev
2023-06-21 13:47       ` Mathieu Desnoyers via lttng-dev
2023-06-21 14:21         ` Yitschak, Yehuda via lttng-dev
2023-09-10 14:18           ` Mousa, Anas via lttng-dev
2023-09-11 15:52             ` Mathieu Desnoyers via lttng-dev
2023-09-11 16:20               ` Michel Dagenais via lttng-dev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e06b605ec9f446da5dc8948c8621518@amazon.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=anasmous@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).