From: Donghyun Lee Date: Thu, 30 Apr 2015 06:47:50 +0000 (+0900) Subject: LB reviewed (t-trace, phonenumber_util) X-Git-Tag: tizen_3.0/TD_SYNC/20161201~857 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97c61b8a6d409d5b312b2c7566bd2561f357a1cd;p=sdk%2Fonline-doc.git LB reviewed (t-trace, phonenumber_util) Signed-off-by: Donghyun Lee --- diff --git a/org.tizen.devtools/html/common_tools/t_trace.htm b/org.tizen.devtools/html/common_tools/t_trace.htm new file mode 100644 index 0000000..8822509 --- /dev/null +++ b/org.tizen.devtools/html/common_tools/t_trace.htm @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + T-trace + + + + + + +
+ +

T-trace

+ +

The T-trace is a profiling tool that allows you to optimize application performance by measuring and visualizing instrumented function calls in the Tizen platform. It helps you to understand what the system is doing while your application is running.

+ + + + + + + + + + +
Note
To operate the T-trace, you must first install Python (2.7.x) and Google Chrome™ on your computer.
+ +

T-trace Dialog

+ +

The following figure illustrates the T-trace dialog elements.

+ +

Figure: T-trace dialog

+

T-trace dialog

+ +
  1. Tags +

    You can define which categories to trace. Currently, the T-trace provides several Tizen platform-specific categories, and a few low level system information categories. The Linux kernel and Tizen platform modules (such as EFL, xorg, and mmfw) support the categories.

    +

    To enable the categories you want, select the applicable check boxes.

  2. +
  3. Bootup +

    Select the check box to reboot the target and start tracing for the platform boot. When tracing is finished, the result can be displayed on a viewer.

  4. +
  5. Reset +

    Select the check box to return all tags and options in the T-trace dialog to their default values.

  6. +
  7. Time(secs) +

    Set the time period to be used for tracing. You can select a predefined value of 10, 30, 60, or 120 seconds, enter a value of your own, or select manual (which means that no specific tracing time is set and you stop tracing when you want).

  8. +
  9. Buffer(kb) +

    Set the target buffer size. You can select a predefined value of 1024, 2048, 4096, or 10240 kb. If the set buffer size is insufficient, the oldest trace data is overwritten to accommodate new data.

  10. +
  11. Main button +

    The main button allows you to control the tracing process based on the current operation state:

    +
      +
    • Ready to trace +

      When the Ready to trace button is displayed, click it to start tracing based on the selected tags and settings.

    • +
    • No Connection +

      When the No Connection button is displayed, you cannot perform any trace operations. Connect a target device to the computer to see the Ready to trace button.

    • +
    • Waiting +

      When the Waiting button is displayed, the T-trace is working on the target and you must wait for it to finish.

    • +
    • Stop +

      When the Stop button is displayed, click it to stop the tracing process. This button is displayed when the trace operation is started with the time period set to manual.

    • +
    • Show result +

      When the Show result button is displayed, the tracing process is finished. Click the button to run the viewer.

+ + +

Running the T-trace

+ +

When you run the T-trace, the tracing process gathers traces during a specified time period. After tracing is finished, the T-trace processes the traces and creates a trace report in the HTML format.

+ +

To run the T-trace in the Tizen IDE:

+
    +
  1. Set up the target device for the debugging mode and connect it to your computer with a USB cable.
  2. +
  3. Install your application on the target device.
  4. +
  5. In the Project Explorer view, right-click the project and select Profile as > Profile With T-trace. +

    The T-trace for TizenSDK dialog opens.

    +
  6. +
  7. In the dialog, set the tracing options and click Ready to trace.
  8. +
+ +

You can also run the T-trace from the command line. The T-trace script is located in the <TIZEN_SDK>/tools/ttrace directory, and it requires that Python (2.7.x) or later to be installed on your computer.

+ +

To run the T-trace from the command line:

+
    +
  1. Open command prompt and move to the T-trace script directory: +
    +$ cd TIZEN_SDK_HOME/tools/ttrace
    +
  2. +
  3. Run the T-trace script with applicable options: +
    +$ python ttrace.py –-time=10 –-buf-size=10240 –o output_filename.html
    +

    For more information on the command options, access the help:

    +
    +$ python ttrace.py --help
    +
  4. +
+ + +

Viewing the Tracing Result

+ +

The results are stored in the <TIZEN_SDK>/tools/ttrace/trace directory. Both a .text binary-format trace file and a .html result report file are generated. The files are named with a timestamp (YYYYMMDDHHMMSS).

+ +

You can view the results using the Google Chrome™ browser as a viewer. The viewer is launched with the result report when you click Show result in the T-trace dialog. If you run the T-trace from the command line, open the result report manually in the viewer.

+ +

Figure: T-trace viewer

+

T-trace viewer

+ +

The following table lists the keyboard shortcuts available in the viewer.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table: Viewer keyboard shortcuts
KeyDescription
wZoom into the trace timeline.
sZoom out of the trace timeline.
aPan left on the trace timeline.
dPan right on the trace timeline.
eCenter the trace timeline on the current mouse location.
gShow the grid at the start of the currently selected task.
Shift+gShow the grid at the end of the currently selected task.
Right arrowSelect the next event on the currently selected timeline.
Left arrowSelect the previous event on the currently selected timeline.
Double-clickZoom into the trace timeline.
Shift+Double-clickZoom out of the trace timeline.
+ +

Result Report

+ +

The result report allows you to analyze various performance aspects of your application. The report shows how your application interacts with the Tizen framework, according to category tags you selected for tracing. The following table shows the kind of information each tag provides.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table: Tag-specific information
TagDescription
Application managerShows how the application life-cycle management works.
CameraShows the workflow of the camera module.
InputShows how to process user input events from, for example, touch and keyboard.
VideoShows the workflow of the video and radio system.
WebShows the workflow of the Web Runtime and Web Engine.
Window managerShows the state changes of the window system, such as show, hide, resize, and rotation.
ImageShows information on image processing, such as rotation, resize, and encoding.
+ +

Application life-cycle analysis example:

+ +

You can analyze your application life-cycle using the T-trace in both native and Web applications. The following figure illustrates the various states of a Tizen application. The T-trace shows you the state changes as well as how much time is consumed at each state while the application is launching, running, and terminating.

+ +

Figure: Application life-cycle

+

Application life-cycle

+ +

To analyze the application life-cycle, run the T-trace with the Application manager tag. For Web applications, enable the Web tag too. When the tracing process is finished, the T-trace generates a report, as shown in the following figure.

+ +

Figure: Application life-cycle report

+

Application life-cycle report

+ +

In the section for Kernel and application processes, you can see your application state changes and system information, such as the CPU frequency and kernel task scheduling on a common timeline. With this information, you can investigate in which state your application spends unnecessary time and then make changes to optimize the time usage.

+ + + + + +
+ +Go to top + + + + + + + diff --git a/org.tizen.devtools/html/images/mw_icon_optional.png b/org.tizen.devtools/html/images/mw_icon_optional.png new file mode 100644 index 0000000..4fbf95b Binary files /dev/null and b/org.tizen.devtools/html/images/mw_icon_optional.png differ diff --git a/org.tizen.devtools/html/images/ttrace_dialog.png b/org.tizen.devtools/html/images/ttrace_dialog.png new file mode 100644 index 0000000..0009164 Binary files /dev/null and b/org.tizen.devtools/html/images/ttrace_dialog.png differ diff --git a/org.tizen.devtools/html/images/ttrace_lifecycle.png b/org.tizen.devtools/html/images/ttrace_lifecycle.png new file mode 100644 index 0000000..4590d63 Binary files /dev/null and b/org.tizen.devtools/html/images/ttrace_lifecycle.png differ diff --git a/org.tizen.devtools/html/images/ttrace_report.png b/org.tizen.devtools/html/images/ttrace_report.png new file mode 100644 index 0000000..637d355 Binary files /dev/null and b/org.tizen.devtools/html/images/ttrace_report.png differ diff --git a/org.tizen.devtools/html/images/ttrace_viewer.png b/org.tizen.devtools/html/images/ttrace_viewer.png new file mode 100644 index 0000000..737bd14 Binary files /dev/null and b/org.tizen.devtools/html/images/ttrace_viewer.png differ diff --git a/org.tizen.devtools/html/images/wn_icon.png b/org.tizen.devtools/html/images/wn_icon.png new file mode 100644 index 0000000..bb5c915 Binary files /dev/null and b/org.tizen.devtools/html/images/wn_icon.png differ diff --git a/org.tizen.devtools/html/images/wn_icon_optional.png b/org.tizen.devtools/html/images/wn_icon_optional.png new file mode 100644 index 0000000..eef91b9 Binary files /dev/null and b/org.tizen.devtools/html/images/wn_icon_optional.png differ diff --git a/org.tizen.devtools/html/images/ww_icon_optional.png b/org.tizen.devtools/html/images/ww_icon_optional.png new file mode 100644 index 0000000..464ba76 Binary files /dev/null and b/org.tizen.devtools/html/images/ww_icon_optional.png differ diff --git a/org.tizen.guides/html/images/oauth2_auth_code.png b/org.tizen.guides/html/images/oauth2_auth_code.png new file mode 100644 index 0000000..d57afd0 Binary files /dev/null and b/org.tizen.guides/html/images/oauth2_auth_code.png differ diff --git a/org.tizen.guides/html/images/oauth2_client_credentials.png b/org.tizen.guides/html/images/oauth2_client_credentials.png new file mode 100644 index 0000000..487ef12 Binary files /dev/null and b/org.tizen.guides/html/images/oauth2_client_credentials.png differ diff --git a/org.tizen.guides/html/images/oauth2_implicit.png b/org.tizen.guides/html/images/oauth2_implicit.png new file mode 100644 index 0000000..e78dee8 Binary files /dev/null and b/org.tizen.guides/html/images/oauth2_implicit.png differ diff --git a/org.tizen.guides/html/images/oauth2_password.png b/org.tizen.guides/html/images/oauth2_password.png new file mode 100644 index 0000000..0bdd463 Binary files /dev/null and b/org.tizen.guides/html/images/oauth2_password.png differ diff --git a/org.tizen.guides/html/images/oauth2_protocol_flow.png b/org.tizen.guides/html/images/oauth2_protocol_flow.png new file mode 100644 index 0000000..c2c5860 Binary files /dev/null and b/org.tizen.guides/html/images/oauth2_protocol_flow.png differ diff --git a/org.tizen.guides/html/images/wn_icon.png b/org.tizen.guides/html/images/wn_icon.png new file mode 100644 index 0000000..bb5c915 Binary files /dev/null and b/org.tizen.guides/html/images/wn_icon.png differ diff --git a/org.tizen.guides/html/images/wn_icon_optional.png b/org.tizen.guides/html/images/wn_icon_optional.png new file mode 100644 index 0000000..eef91b9 Binary files /dev/null and b/org.tizen.guides/html/images/wn_icon_optional.png differ diff --git a/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm b/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm new file mode 100644 index 0000000..0cac351 --- /dev/null +++ b/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm @@ -0,0 +1,68 @@ + + + + + + + + + + + + + Phonenumber-utils + + + + + +
+

Phonenumber-utils

+ +

Tizen enables you to parse and format phone numbers. The Phonenumber-utils APIs are implemented with the libphonenumber opensource library.

+ +

The main features of the Phonenumber-utils API include:

+ +
  • Retrieving the location information +

    You can get the location based on the phone number, region, and language using the phone_number_get_location_from_number() function. If the function cannot provide the location with the passed language, it uses English.

  • + +
  • Formatting the phone number +

    You can format the phone number string based on the region using the dash ("-") and space (" ") characters using the phone_number_get_formatted_number() function.

  • +
+ + + +
+ +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/telephony/phonenumber_util_n.htm b/org.tizen.tutorials/html/native/telephony/phonenumber_util_n.htm new file mode 100644 index 0000000..0cac351 --- /dev/null +++ b/org.tizen.tutorials/html/native/telephony/phonenumber_util_n.htm @@ -0,0 +1,68 @@ + + + + + + + + + + + + + Phonenumber-utils + + + + + +
+

Phonenumber-utils

+ +

Tizen enables you to parse and format phone numbers. The Phonenumber-utils APIs are implemented with the libphonenumber opensource library.

+ +

The main features of the Phonenumber-utils API include:

+ +
  • Retrieving the location information +

    You can get the location based on the phone number, region, and language using the phone_number_get_location_from_number() function. If the function cannot provide the location with the passed language, it uses English.

  • + +
  • Formatting the phone number +

    You can format the phone number string based on the region using the dash ("-") and space (" ") characters using the phone_number_get_formatted_number() function.

  • +
+ + + +
+ +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm b/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm new file mode 100644 index 0000000..9ed6a58 --- /dev/null +++ b/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + Phonenumber-utils: Parsing and Formatting Phone Numbers + + + + + + +
+

Phonenumber-utils: Parsing and Formatting Phone Numbers

+ + +

This tutorial demonstrates how you can parse and format phone numbers.

+

Warm-up

+

Become familiar with the Phonenumber-utils API basics by learning about:

+ + +

Getting the Location

+ +

To get the location from the phone number:

+ +
    + +
  1. To use the functions and data types of the Phonenumber-utils API (in mobile and wearable applications), include the <phone_number.h> header file in your application:

    +
    +#include <phone_number.h>
    +
    +
  2. +
  3. To get the location, use the phone_number_get_location_from_number() function:

    + +
    int ret;
    +char *location = NULL;
    +
    +ret = phone_number_get_location_from_number("0222550114", PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, 
    +                                            PHONE_NUMBER_LANG_ENGLISH, &location);
    +if (PHONE_NUMBER_ERROR_NONE == ret) 
    +{
    +   // Use location
    +   // location – "Seoul"
    +   dlog_print(DLOG_DEBUG, LOG_TAG, "location=%s", location);
    +}
    +free(location);
    +
    + +
+ +

Formatting the Number

+

To format the phone number:

+ +
    + +
  1. To use the functions and data types of the Phonenumber-utils API (in mobile and wearable applications), include the <phone_number.h> header file in your application:

    +
    +#include <phone_number.h>
    +
    +
  2. +
  3. Use the region to format the phone number:

    + +
    int ret;
    +char *formatted_number = NULL;
    +
    +ret = phone_number_get_formatted_number("0222550114", PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, 
    +                                        &formatted_number);
    +if (PHONE_NUMBER_ERROR_NONE == ret) 
    +{
    +   // Use formatted_number
    +   // formatted_number - "02-2255-0114"
    +   dlog_print(DLOG_DEBUG, LOG_TAG, "formatted_number=%s", formatted_number);
    +}
    +free(formatted_number);
    +
    + +
+ + + + +
+ +Go to top + + + + + + +