Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Running A Profiled App on X86_64 Android Emulator Qt6.9.1
Forum Updated to NodeBB v4.3 + New Features

Running A Profiled App on X86_64 Android Emulator Qt6.9.1

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
14 Posts 4 Posters 247 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SMF-QtS Online
    SMF-QtS Online
    SMF-Qt
    wrote last edited by SMF-Qt
    #1

    I am trying to investigate a Qt6 performance issue with an application I am working on running on an X86_64 Android emulator .
    see [https://forum.qt.io/topic/162592/android-x86_64-app-crashes-before-reaching-qt-main].
    I have turned on the clang++ profiling support ( -fprofile-instr-generate and -fcoverage-mapping ) when I compile my app, but I cannot find where the output is going in the emulator.
    I am not even sure if this is the correct method.
    Also I don't think my application is exiting properly which may mean the profiling information is not being written out even though I am calling "exit()" at the end of my main.cxx.
    Under the debugger the code usually ends of in what looks like a java abort routine and the display seems to show some sort of shell remaining:

    Screenshot_20250716_150833_One UI Home.jpg screenshot from Samsung Tab9 runnning the same app compiled for arm64-v8a.

    Any help would be good thanks.

    SMF-QtS 1 Reply Last reply
    0
    • SMF-QtS SMF-Qt

      I am trying to investigate a Qt6 performance issue with an application I am working on running on an X86_64 Android emulator .
      see [https://forum.qt.io/topic/162592/android-x86_64-app-crashes-before-reaching-qt-main].
      I have turned on the clang++ profiling support ( -fprofile-instr-generate and -fcoverage-mapping ) when I compile my app, but I cannot find where the output is going in the emulator.
      I am not even sure if this is the correct method.
      Also I don't think my application is exiting properly which may mean the profiling information is not being written out even though I am calling "exit()" at the end of my main.cxx.
      Under the debugger the code usually ends of in what looks like a java abort routine and the display seems to show some sort of shell remaining:

      Screenshot_20250716_150833_One UI Home.jpg screenshot from Samsung Tab9 runnning the same app compiled for arm64-v8a.

      Any help would be good thanks.

      SMF-QtS Online
      SMF-QtS Online
      SMF-Qt
      wrote last edited by SMF-Qt
      #2

      @SMF-Qt

      I have found that if I tap the "shell" my application restarts so even though I have called exit my app seems to have not really shutdown (a requirement for profiling).
      Can anyone explain this behaviour please.

      my current code to exit my app is:

      ...
      app->setQuitOnLastWindowClosed(true);
      ret=app->exec();
      }
      db_conn.close();
      }
      delete app;
      exit(ret);
      }

      jsulmJ 1 Reply Last reply
      0
      • SMF-QtS SMF-Qt

        @SMF-Qt

        I have found that if I tap the "shell" my application restarts so even though I have called exit my app seems to have not really shutdown (a requirement for profiling).
        Can anyone explain this behaviour please.

        my current code to exit my app is:

        ...
        app->setQuitOnLastWindowClosed(true);
        ret=app->exec();
        }
        db_conn.close();
        }
        delete app;
        exit(ret);
        }

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote last edited by
        #3

        @SMF-Qt said in Running A Profiled App on X86_64 Android Emulator Qt6.9.1:

        I have found that if I tap the "shell"

        What shell do you mean?
        On Android you need to stop an application explicitly.
        On a phone you tap on the bottom right button and swipe up the app you want to close.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        SMF-QtS 1 Reply Last reply
        0
        • jsulmJ jsulm

          @SMF-Qt said in Running A Profiled App on X86_64 Android Emulator Qt6.9.1:

          I have found that if I tap the "shell"

          What shell do you mean?
          On Android you need to stop an application explicitly.
          On a phone you tap on the bottom right button and swipe up the app you want to close.

          SMF-QtS Online
          SMF-QtS Online
          SMF-Qt
          wrote last edited by
          #4

          @jsulm

          So from what you have said my c++ exit does not close the "App" that has to be done by swiping up the what I call a shell (or is it a java wrapper)?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote last edited by
            #5

            Hi,

            Are you sure you are closing your application and not just putting it in the background ? Just leaving it to return to the shell (the name is confusing as most people associate shell with a terminal running bash, zsh, etc.) does not equal stopping it.
            Also

            return ret;
            

            would be the expect way to end your application.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • SMF-QtS Online
              SMF-QtS Online
              SMF-Qt
              wrote last edited by
              #6

              Yes I was using "return ret;" How would you suggest I close my App?
              Thanks

              JonBJ 1 Reply Last reply
              0
              • SMF-QtS SMF-Qt

                Yes I was using "return ret;" How would you suggest I close my App?
                Thanks

                JonBJ Online
                JonBJ Online
                JonB
                wrote last edited by
                #7

                @SMF-Qt
                But your code shows you using exit(ret);. @SGaist is suggesting you try replacing it with return ret; (assuming what you showed is in your main()) in case that makes any difference. Have you tried that?

                You might put some qDebug() or whatever is appropriate immediately above that just to make sure whether your app really is exiting the exec() loop.

                SMF-QtS 1 Reply Last reply
                0
                • JonBJ JonB

                  @SMF-Qt
                  But your code shows you using exit(ret);. @SGaist is suggesting you try replacing it with return ret; (assuming what you showed is in your main()) in case that makes any difference. Have you tried that?

                  You might put some qDebug() or whatever is appropriate immediately above that just to make sure whether your app really is exiting the exec() loop.

                  SMF-QtS Online
                  SMF-QtS Online
                  SMF-Qt
                  wrote last edited by SMF-Qt
                  #8

                  @JonB

                  I started with that and it is back in the current main.cpp. The behavior is the same.
                  The debug version on the X86_64 simulator goes throught this code so I assume the arm64-v8a version on my phones and tablet does too.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote last edited by
                    #9

                    As I wrote before, just returning to the shell does not mean your application is closed.
                    You have to explicitly close it.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    SMF-QtS 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      As I wrote before, just returning to the shell does not mean your application is closed.
                      You have to explicitly close it.

                      SMF-QtS Online
                      SMF-QtS Online
                      SMF-Qt
                      wrote last edited by
                      #10

                      @SGaist

                      Thanks but I don't know how that is done on Android.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote last edited by
                        #11

                        AFAIR, if you swipe from the bottom up, it should show you all the applications that are running and you can there stop them.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        SMF-QtS 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          AFAIR, if you swipe from the bottom up, it should show you all the applications that are running and you can there stop them.

                          SMF-QtS Online
                          SMF-QtS Online
                          SMF-Qt
                          wrote last edited by
                          #12

                          @SGaist

                          Yes I know that but I was looking for a programatic way.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote last edited by
                            #13

                            Depending on what you have in mind, a QTimer calling the application quit slot might do what you want.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            SMF-QtS 1 Reply Last reply
                            0
                            • SGaistS SGaist

                              Depending on what you have in mind, a QTimer calling the application quit slot might do what you want.

                              SMF-QtS Online
                              SMF-QtS Online
                              SMF-Qt
                              wrote last edited by SMF-Qt
                              #14

                              @SGaist

                              Thanks but I have a quit button on my app which calls QWidget::close on the top level widget which shuts down my application apart from the database which is handled by main.
                              I have set app->setQuitOnLastWindowClosed(true); and app->exec() is returning 0 so everything is shutdown. once app->exec() returns the database is closed and the app destructors are run via the delete app at the very end of main. I am confident having debugged the emulated version of my app that my code is shutting everything down and exiting with a return value of 0.

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved