Results 1 to 4 of 4
  1. #1

    May I ask a question about Android here?

    I am a student and I have to do an experiment about software stress test.

    I installed Android emulator on Ubuntu to simulate an Android equipment.
    The experiment should be conductinig stress test on one or some applications.
    At the same time, I need to obtain the memory variation of the Android emulator(especially free memory).

    I am considering using awk of busybox to get information from /proc/meminfo of the Android in the adb shell.
    But I failed to write a script to get these information periodically.For example, every 10 minutes.
    I am sorry that my English is not good enough.
    I meant that I can get the memory information by input "cat /proc/meminfo" in the adb shell.
    But I need to get the information repeatly, e.g. 1 for a minute.
    I don't know how to compile and save a script in the adb shell or ourput the log file into Linux's folders.

    Before this experiment, I wrote an script to measure the memory information of a Ubuntu system, like this


    Code:
    Code:
    LOG_FILE="output of sysmon.csv"
    
    echo "ElapsedTime,Buffers(kb),SwapCached(kb),SwapFree(kb),Mapped(kb),MemFree(kb)" > "$LOG_FILE"
    
    ELAPSED_TIME=`date +%D:%H:%M:%S:%N`      #hour, minute, second, nanu second
    PERIOD=184                            # seconds
    
    while :
    do
      Buffers=`awk '/Buffers/ {print $2}' < "/proc/meminfo"`
      SwapCached=`awk '/SwapCached/ {print $2}' < "/proc/meminfo"`
      SwapFree=`awk '/SwapFree/ {print $2}' < "/proc/meminfo"`
      Mapped=`awk '/Mapped/ {print $2}' < "/proc/meminfo"`
      MemFree=`awk '/MemFree/ {print $2}' < "/proc/meminfo"`
        
      echo "$ELAPSED_TIME,$Buffers,$SwapCached,$SwapFree,$Mapped,$MemFree" >> "$LOG_FILE"
      sleep "$PERIOD"
      ELAPSED_TIME=`date +%D:%H:%M:%S:%N`
    done
    Could you please give me any suggestion?
    Is there a method to use the script in the Linux shell, but obtaining the memory information in the /proc/meminfo of the emulator?
    Thank you very much!
    Last edited by koshihaku; 09-19-2011 at 09:19 PM. Reason: the description of the question is not enough

  2. #2
    Member
    Join Date
    Aug 2011
    Location
    Wroclaw, Poland
    Posts
    44
    You did not mentioned what exactly "failed". Script has errors? No log file created?



  3. #3
    I am sorry that my English is not good enough.

    I meant that I can get the memory information by input "cat /proc/meminfo" in the adb shell.
    But I need to get the information repeatly, e.g. 1 for a minute.
    I don't know how to compile and save a script in the adb shell or ourput the log file into Linux's folders.

    Is there a method to use the script in the Linux shell, but obtaining the memory information in the /proc/meminfo of the emulator?



  4. #4
    Member
    Join Date
    Aug 2011
    Location
    Wroclaw, Poland
    Posts
    44
    You no need to compile scripts, just copy to android by "adb push", make executable and run. Maybe root access and/or S-OFF will be needed for that. But you can also issue on PC commands like
    Code:
    adb pull /proc/meminfo /tmp/android-meminfo
    Buffers=`awk '/Buffers/ {print $2}' /tmp/android-meminfo`
    # and so on...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •