Exemple #1
0
def DumpScreenOnOffLogs(WS):
    """ Dump screen on and off logs i.e display on off

    :param WS: Workspace object
    :return: True on sccess and False on failure
    """
    try:
        f_power_logs_buf = open(WS.file_power_logs, 'w+')
    except IOError as err:
        error = 'failed to create power log file : ' + str(err)
        util.PLOGE(TAG, error)

    try:
        f_event_logs_buf = open(WS.file_event_logs, 'r')
    except IOError as err:
        error = 'failed to read event log file : ' + str(err)
        util.PLOGE(TAG, error)

    util.PrintLogFileTitle(f_power_logs_buf, 'Power logs')
    f_power_logs_buf.write('--- Screen ON and OFF ---')
    f_power_logs_buf.write(util.get_empty_line())
    f_power_logs_buf.write(util.get_empty_line())

    for line in f_event_logs_buf:
        if pattr.screen_on.search(line) or \
                pattr.screen_off.search(line) :
            f_power_logs_buf.write(line)
    f_power_logs_buf.write(util.get_empty_line())

    f_power_logs_buf.close()
    f_event_logs_buf.close()
def DumpUptime(WS, file_buf):
    """Dump uptime
    """
    bool_start_dump = False
    try:
        f_other = open(WS.file_other, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_accounts + \
                  '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_other.write(util.get_line())
    f_other.write('--- Other ---\n')
    f_other.write(util.get_line())
    f_other.write(util.get_empty_line())

    for line in file_buf:
        if bool_start_dump:
            f_other.write(line)
        if patt.start_uptime.search(line):
            f_other.write(line)
            bool_start_dump = True
        if patt.end_uptime.search(line):
            bool_start_dump = False
            break

    f_other.write(util.get_empty_line())
    f_other.close()
    return True
def DumpVMtracesForNow(WS, file_buf):
    """Dump VM TRACES FOR NOW for anr
    """
    bool_start_dump = False
    try:
        f_other = open(WS.file_anr_logs, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_anr_logs + \
                  '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_other.write(util.get_line())
    f_other.write('--- VM TRACES FOR NOW for anr ---\n')
    f_other.write(util.get_line())
    f_other.write(util.get_empty_line())

    for line in file_buf:
        if bool_start_dump:
            f_other.write(line)
        if patt.start_anr_all.search(line):
            f_other.write(line)
            bool_start_dump = True
        if patt.end_anr_all.search(line):
            bool_start_dump = False
            break

    f_other.write(util.get_empty_line())
    f_other.close()
    return True
 def WriteReportTitle():
     mFile_rpt_buf.write(util.get_line())
     mFile_rpt_buf.write('BUGREPORT ANALYSIS')
     mFile_rpt_buf.write(util.get_empty_line())
     mFile_rpt_buf.write(util.get_line())
     mFile_rpt_buf.write(util.get_empty_line())
     mFile_rpt_buf.write(util.get_empty_line())
    def WriteNativeCrash():
        native_crash = False
        native_crash_list = []
        cont = False
        if os.path.exists(WS.file_ws_system_native_crash):
            with open(WS.file_ws_system_native_crash) as native_crash_buf:
                for line in native_crash_buf:
                    if cont or re.compile('F DEBUG   : pid:').search(line):
                        native_crash = True
                        cont = True
                        native_crash_list.append(line)
                    if re.compile('F DEBUG   : Abort message:').search(line):
                        native_crash_list.append('#')
                        cont = False
                WriteTitleAndValue('Native crash', '--->>>')
                mFile_rpt_buf.write(util.get_line())

                for item in native_crash_list:
                    if item == '#':
                        mFile_rpt_buf.write(util.get_empty_line())
                        continue
                    mFile_rpt_buf.write(item)

                native_crash_buf.close()

        if not native_crash:
            WriteTitleAndValue('Native crash', 'None')
            mFile_rpt_buf.write(util.get_line())
            return
def DumpBuildDetails(WS, file_buf):
    """Dump build details
    """
    try:
        f_build_details = open(WS.file_build_details, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + \
                  WS.file_build_details + '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_build_details.write(util.get_line())
    f_build_details.write('--- Build details ---\n')
    f_build_details.write(util.get_line())

    for line in file_buf:
        if patt.start_of_file.match(line):
            continue
        if patt.start_dumpsys_meminfo.search(line):
            break
        f_build_details.write(line)

    f_build_details.write(util.get_empty_line())
    f_build_details.close()
    return True
def DumpKernelLogs(WS, file_buf):
    """Dump kernel logs
    """
    bool_start_dump = False
    try:
        f_kernel_logs = open(WS.file_kernel_logs, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_kernel_logs + \
                  '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_kernel_logs.write(util.get_line())
    f_kernel_logs.write('--- Kernel logs (dmesg) ---\n')
    f_kernel_logs.write(util.get_line())

    for line in file_buf:
        # print line,
        if bool_start_dump:
            f_kernel_logs.write(line)
        if patt.start_kernel_log.search(line):
            bool_start_dump = True
        if patt.end_kernel_log.search(line):
            bool_start_dump = False
            break

    f_kernel_logs.write(util.get_empty_line())
    f_kernel_logs.close()
    return True
    def WriteApplicationAnr():
        app_anr = None
        app_anr_list = []
        cont = False
        if os.path.exists(WS.file_ws_system_anr):
            with open(WS.file_ws_system_anr) as app_anr_buf:
                for line in app_anr_buf:
                    if cont or re.compile('E ActivityManager: ANR in ').search(
                            line):
                        app_anr = True
                        cont = True
                        app_anr_list.append(line)
                    if re.compile('E ActivityManager: Reason: ').search(line):
                        app_anr_list.append('#')
                        cont = False

            WriteTitleAndValue('Application ANR', '--->>>')
            mFile_rpt_buf.write(util.get_line())

            if app_anr is not None:
                for item in app_anr_list:
                    if item == '#':
                        mFile_rpt_buf.write(util.get_empty_line())
                        continue
                    mFile_rpt_buf.write(item)

            app_anr_buf.close()

        if app_anr is None:
            WriteTitleAndValue('Application ANR', app_anr)
            mFile_rpt_buf.write(util.get_line())
            return
    def WriteApplicationCrash():
        app_crash = None
        app_crash_list = []
        cont = False
        if os.path.exists(WS.file_ws_system_app_crash):
            with open(WS.file_ws_system_app_crash) as app_crash_buf:
                for line in app_crash_buf:
                    if cont or re.compile(
                            'E AndroidRuntime: FATAL EXCEPTION:').search(line):
                        app_crash = True
                        cont = True
                        app_crash_list.append(line)
                    if re.compile('E AndroidRuntime: android.os.').search(line) or \
                            re.compile('E AndroidRuntime: java.lang.').search(line):
                        app_crash_list.append('#')
                        cont = False

            WriteTitleAndValue('Application crash', '--->>>')
            mFile_rpt_buf.write(util.get_line())

            if app_crash is not None:
                for item in app_crash_list:
                    if item == '#':
                        mFile_rpt_buf.write(util.get_empty_line())
                        continue
                    mFile_rpt_buf.write(item)

            app_crash_buf.close()

        if app_crash is None:
            WriteTitleAndValue('Application crash', app_crash)
            mFile_rpt_buf.write(util.get_line())
            return
def DumpAccounts(WS, file_buf):
    """Dump Account information
    """
    bool_start_dump = False
    try:
        f_accounts = open(WS.file_accounts, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_accounts + \
                  '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_accounts.write(util.get_line())
    f_accounts.write('--- Accounts ---\n')
    f_accounts.write(util.get_line())

    for line in file_buf:
        if bool_start_dump:
            f_accounts.write(line)
        if patt.start_accounts.search(line):
            bool_start_dump = True
        if patt.end_accounts.search(line):
            bool_start_dump = False
            break

    f_accounts.write(util.get_empty_line())
    f_accounts.close()
    return True
def DumpRadioLogs(WS, file_buf):
    """ Dump radio logs
    """
    bool_start_dump = False
    try:
        f_radio_logs = open(WS.file_radio_logs, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_radio_logs + \
                  '\n' + str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_radio_logs.write(util.get_line())
    f_radio_logs.write('--- Radio logs ---\n')
    f_radio_logs.write(util.get_line())

    for line in file_buf:
        if bool_start_dump:
            f_radio_logs.write(line)
        if patt.start_radio_log.search(line):
            bool_start_dump = True
        if patt.end_radio_log.search(line):
            bool_start_dump = False
            break

    f_radio_logs.write(util.get_empty_line())
    f_radio_logs.close()
    return True
Exemple #12
0
def GetAppCrashes(WS):
    """Dump application crash logs

    :param WS: WorkSpace object
    :return: True on Success and False on Failure
    """
    try:
        f_system_log_buf = open(WS.file_system_logs, 'r')
    except IOError as err:
        errorString = "failed to read system logs " + \
                      str(err)
        util.PLOGE(errorString)
        return False

    try:
        f_app_crash_buf = open(WS.file_ws_system_app_crash, 'w+')
    except IOError as err:
        errorString = 'failed to create application crash log file ' + \
                      str(err)
        util.PLOGE(errorString)
        return False

    f_app_crash_buf.write(util.get_line())
    f_app_crash_buf.write("--- Application crash ---")
    f_app_crash_buf.write(util.get_empty_line())
    f_app_crash_buf.write(util.get_line())
    f_app_crash_buf.write(util.get_empty_line())
    found_crash = False
    for line in f_system_log_buf:
        if pattr.start_crash_application.search(line):
            found_crash = True
            f_app_crash_buf.write(util.get_empty_line())
            f_app_crash_buf.write(util.get_line())
        if pattr.end_crash_application.search(line):
            f_app_crash_buf.write(line)

    f_system_log_buf.close()
    f_app_crash_buf.close()

    if not found_crash:
        os.remove(WS.file_ws_system_app_crash)
        util.PLOGV(TAG, "Opps, No application crash")

    return True
def DumpDevinfo(WS, dict_devinfo):
    """Dump device information
    """
    try:
        f_devinfo = open(WS.file_devinfo, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_devinfo + \
                  str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_devinfo.write(util.get_line())
    f_devinfo.write('--- devinfo ---\n')
    f_devinfo.write(util.get_line())

    for item in dict_devinfo:
        f_devinfo.write(util.get_empty_line())
        f_devinfo.write(dict_devinfo[item])

    f_devinfo.write(util.get_empty_line())
    f_devinfo.close()
    return True
Exemple #14
0
def DumpPowerLogs(WS):
    """Dump power logs

    :param WS: WorkSpace object
    :return: True on Success and False on Failure
    """
    try:
        f_power_logs_buf = open(WS.file_power_logs, 'a+')
    except IOError as err:
        error = 'failed to create power log file : ' + str(err)
        util.PLOGE(TAG, error)
        return False

    try:
        f_sys_logs_buf = open(WS.file_system_logs, 'r')
    except IOError as err:
        error = 'failed to read event log file : ' + str(err)
        util.PLOGE(TAG, error)
        return False

    try:
        f_kernel_logs_buf = open(WS.file_kernel_logs, 'r')
    except IOError as err:
        error = 'failed to read event log file : ' + str(err)
        util.PLOGE(TAG, error)
        return False

    f_power_logs_buf.write('--- PowerManager ---')
    f_power_logs_buf.write(util.get_empty_line())
    f_power_logs_buf.write(util.get_empty_line())

    for line in f_sys_logs_buf:
        if pattr.device_sys_sleep_power_button.search(line) or \
                pattr.device_sys_sleep_screen_timeout.search(line) or \
                pattr.device_sys_wake_up.search(line):
            f_power_logs_buf.write(line)
    f_power_logs_buf.write(util.get_empty_line())

    f_power_logs_buf.write('--- Kernel ---')
    f_power_logs_buf.write(util.get_empty_line())
    f_power_logs_buf.write(util.get_empty_line())

    for line in f_kernel_logs_buf:
        if pattr.device_kernel_sleep.search(line) or \
                pattr.device_sys_sleep_screen_timeout.search(line) or \
                pattr.device_kernel_wakeup.search(line):
            f_power_logs_buf.write(line)
    f_power_logs_buf.write(util.get_empty_line())

    f_power_logs_buf.close()
    f_sys_logs_buf.close()
    f_kernel_logs_buf.close()
    return True
    def WriteDeviceOwnerAndAccount():
        user = None
        acc_list = []
        with open(WS.file_accounts, 'r') as system:
            for line in system:
                email_match = re.search(r'([\w.-]+)@([\w.-]+)', line)
                if email_match:
                    if email_match.group() not in acc_list:
                        acc_list.append(email_match.group())
                if re.compile(r'UserInfo').search(line):
                    user = line.split(':')[1]
        WriteTitleAndValue('Device owner', user)
        WriteTitleAndValue('Device Accounts', '--->>>')
        for account in acc_list:
            mFile_rpt_buf.write((' ' * 32) + account)
            mFile_rpt_buf.write(util.get_empty_line())

        system.close()
Exemple #16
0
def DumpAnalysisPaths():
    """Dump file link to terminal to open file using mouse (Ctrl + right click)
     """
    util.PLOGD(TAG,"Check analysis at below path")
    util.PLOGD(TAG,util.get_line())

    # Analysis
    util.PLOGD(TAG,'--- Analysis ---')
    util.PrintTerminalLink(WS.dir_out)
    util.PrintTerminalLink(WS.dir_ws)
    util.PrintTerminalLink(WS.dir_ws_analysis)
    util.get_empty_line()

    # anr
    util.PLOGD(TAG, '--- Device ---')
    util.PrintTerminalLink(WS.file_devinfo)
    util.PrintTerminalLink(WS.file_build_details)
    util.PrintTerminalLink(WS.file_accounts)
    util.get_empty_line()

    # anr
    util.PLOGD(TAG,'--- ANR ---')
    util.PrintTerminalLink(WS.dir_FS_data_anr)
    util.PrintTerminalLink(WS.dir_analysis_anr)
    util.PrintTerminalLink(WS.file_anr_logs)
    util.get_empty_line()

    # event
    util.PLOGD(TAG,'--- Event ---')
    util.PrintTerminalLink(WS.dir_ws_analysis_events)
    util.PrintTerminalLink(WS.file_event_logs)
    util.PrintTerminalLink(WS.file_ws_events_JP_data)
    util.PrintTerminalLink(WS.file_ws_events_am_proc_start)
    util.PrintTerminalLink(WS.file_ws_events_am_proc_bound)
    util.PrintTerminalLink(WS.file_ws_events_am_proc_died)
    util.PrintTerminalLink(WS.dir_ws_analysis_bypid)
    util.get_empty_line()

    # system
    util.PLOGD(TAG,'--- System ---')
    util.PrintTerminalLink(WS.file_system_logs)
    util.PrintTerminalLink(WS.file_sys_prop)
    util.PrintTerminalLink(WS.file_ws_system_native_crash)
    util.PrintTerminalLink(WS.file_ws_system_app_crash)
    util.PrintTerminalLink(WS.file_ws_system_anr)
    util.get_empty_line()

    # Kernel
    util.PLOGD(TAG,'--- Kernel ---')
    util.PrintTerminalLink(WS.file_kernel_logs)
    util.get_empty_line()

    # Radio
    util.PLOGD(TAG,'--- Radio ---')
    util.PrintTerminalLink(WS.file_radio_logs)
    util.get_empty_line()

    # Other
    util.PLOGD(TAG,'--- Other ---')
    util.PrintTerminalLink(WS.file_avc_logs)
    util.PrintTerminalLink(WS.file_power_logs)
    util.PrintTerminalLink(WS.file_other)
    util.get_empty_line()

    # Report
    util.PLOGD(TAG,'--- Report ---')
    util.PrintTerminalLink(WS.file_analysis_rpt)
    util.PLOGD(TAG,util.get_line())
Exemple #17
0
def GetAppAnr(WS):
    """Dump application ANR logs

    :param WS: WorkSpace object
    :return: True on Success and False on Failure
    """
    anr_pid_dict = {}
    try:
        f_system_log_buf = open(WS.file_system_logs, 'r')
    except IOError as err:
        errorString = "failed to read system logs " + \
                      str(err)
        util.PLOGE(errorString)
        return False

    try:
        f_app_anr_buf = open(WS.file_ws_system_anr, 'w+')
    except IOError as err:
        errorString = 'failed to create application anr log file ' + \
                      str(err)
        util.PLOGE(errorString)
        return False

    f_app_anr_buf.write(util.get_line())
    f_app_anr_buf.write("--- Application ANR ---")
    f_app_anr_buf.write(util.get_empty_line())
    f_app_anr_buf.write(util.get_line())
    f_app_anr_buf.write(util.get_empty_line())
    found_crash = False

    pid_number = None
    process_name = None
    for line in f_system_log_buf:
        if pattr.start_anr_application.search(line):
            process_words = line.split(' E ')
            process_name = process_words[1].split().pop(3)
            found_crash = True
            f_app_anr_buf.write(util.get_empty_line())
            f_app_anr_buf.write(util.get_line())
        if found_crash and pattr.end_anr_application.search(line):
            if re.compile(r'ActivityManager: PID:').search(line):
                word_list = line.split()
                pid_number = word_list[len(word_list) - 1]
                anr_pid_dict[pid_number] = process_name
                pid_number = None
                process_name = None
            f_app_anr_buf.write(line)

    f_system_log_buf.close()
    f_app_anr_buf.close()

    if not found_crash:
        os.remove(WS.file_ws_system_anr)
        util.PLOGV(TAG, "Opps, No application ANR")

    for pid, pid_name in anr_pid_dict.iteritems():
        if (pid and pid_name) is None:
            continue

        if not DumpAnrForPid(WS, pid, pid_name):
            util.PLOGE(TAG,"Failed to get or not found ANR traces for : " + \
                       str(pid) + ' - ' + str(pid_name))

    return True
 def WriteTitleAndValue(title, value):
     mFile_rpt_buf.write(str(PreapreTitle(title)))
     mFile_rpt_buf.write(str(value))
     mFile_rpt_buf.write(util.get_empty_line())
Exemple #19
0
def FilterByPid(WS):
    """ Filter event logs by PID from am_start_proc filter

    :param WS: WorkSpace object
    :return:True on success and False on Failure
    """
    tmpfile = filter.GetFileWithFilterData(WS.file_event_logs,
                                           pattr.am_proc_start)
    if (not tmpfile) or not (os.path.isfile(tmpfile)):
        util.PLOGE(TAG, 'failed to set filter')
        return False

    try:
        f_buf = open(tmpfile, 'r')
    except IOError as err:
        util.PLOGE(TAG, 'failed to read file : ' + str(err))
        return False

    try:
        f_event_aps_buf = open(WS.file_ws_events_am_proc_start, 'w+')
    except IOError as err:
        util.PLOGE(TAG, 'failed to read file : ' + str(err))
        return False

    process_data_aps_title = '##log_timestamp user pid uid name p_typ component data_aps'
    f_event_aps_buf.write(process_data_aps_title)
    f_event_aps_buf.write(util.get_empty_line())

    # get all pid list from am_proc_start
    unwanted = re.compile(r'^[[]+')
    unwanted_1 = re.compile(r'[]\n]+$')
    list_jp_pid = []

    for line_am_proc_start in f_buf:
        JP = util.JavaProcess()
        list_am_proc_start = str(line_am_proc_start).split(': ')
        list_aps_process_data = str(list_am_proc_start[1]).split(',')
        list_aps_time_data = str(list_am_proc_start[0]).split()

        for idx, item in enumerate(list_aps_process_data):
            if unwanted.search(item):
                list_aps_process_data[idx] = str(item).strip('[')
            if unwanted_1.search(item):
                list_aps_process_data[idx] = str(item).strip(']\n')

        JP.log_timestamp = str(list_aps_time_data[0]) + '_' + str(
            list_aps_time_data[1])
        JP.user = list_aps_process_data[0]
        JP.pid = list_aps_process_data[1]
        JP.uid = list_aps_process_data[2]
        JP.name = list_aps_process_data[3]
        JP.p_type = list_aps_process_data[4]
        JP.component = list_aps_process_data[5]

        process_data_aps =  str(JP.log_timestamp) +  ' ' + \
                            str(JP.user) + ' ' + \
                            str(JP.pid) + ' ' + \
                            str(JP.uid) + ' ' + \
                            ' '* (6 - len(JP.uid)) + \
                            str(JP.name) + ' ' + \
                            ' '* (50 - len(JP.name)) + \
                            str(JP.p_type) + ' ' + \
                            ' '* (20 - len(JP.p_type)) + \
                            str(JP.component)
        # print process_data_aps
        f_event_aps_buf.write(process_data_aps)
        f_event_aps_buf.write(util.get_empty_line())

        set_warning = None
        if not JP.pid in list_jp_pid:
            list_jp_pid.append(JP.pid)
        else:
            util.PLOGV(TAG, "The duplicate pid found : " + str(JP.pid))
            set_warning = True
            list_jp_pid.append(JP.pid)

        pid_dir_name = WS.dir_ws_analysis_bypid + '/' + JP.pid
        file_jp_pid_events = pid_dir_name + '/' + 'events_' + JP.pid + '.txt'

        if not os.path.exists(pid_dir_name):
            os.makedirs(pid_dir_name)

        #Open main events file and check for current JP.pid
        util.PLOGV(TAG, " dump event data for : " + pid_dir_name)
        try:
            f_event_buf = open(WS.file_event_logs, 'rU')
        except IOError as err:
            error_str = 'failed to read event file for pid : ' + \
                        JP.pid  + '\n' + str(err)
            util.PLOGE(TAG, error_str)
            return False

        try:
            f_jp_pid_events = open(file_jp_pid_events, 'a+')
        except IOError as err:
            error_str = 'failed to create file_jp_pid_events file for pid : ' + \
                        JP.pid  + '\n' + str(err)
            util.PLOGE(TAG, error_str)
            return False
        if set_warning:
            msg_warn_L1 = "Warning *********************************************************** \n"
            msg_warn_L2 = "Warning ** The " + JP.pid + " might be dumplicate please check *** \n"
            msg_warn_L3 = "Warning *********************************************************** \n"
            util.PLOGV(TAG, msg_warn_L1)
            util.PLOGV(TAG, msg_warn_L2)
            util.PLOGV(TAG, msg_warn_L3)

            f_jp_pid_events.write(msg_warn_L1 + msg_warn_L2 + msg_warn_L3)
            set_warning = None
            msg_warn_L1 = None
            msg_warn_L2 = None
            msg_warn_L3 = None

        #skip title lines
        for each in [1, 2, 3]:
            f_event_buf.readline()

        for event_line in f_event_buf:
            if pattr.end_event_log.search(event_line):
                break
            mTag = evntClasses.Tag()
            if not GetEventTag(mTag, event_line):
                continue
            if not IsLineContainPid(JP.pid, event_line):
                continue
            f_jp_pid_events.write(event_line)
        f_event_buf.close()

    f_buf.close()
    f_event_aps_buf.close()
    util.clean_me(tmpfile)
def DumpSysProp(WS, file_buf):
    """Dump system properties
    """
    def get_prop_val(prop):
        list_prop_val = str(prop).split(': [')
        # print list_prop_val
        return list_prop_val[1].strip('\n').strip(']')

    bool_start_dump = False

    try:
        f_sys_prop = open(WS.file_sys_prop, 'w+')
    except IOError as err:
        err_str = 'failed to create file : ' + WS.file_sys_prop + \
                  str(err)
        util.PLOGE(TAG, err_str)
        return False

    f_sys_prop.write(util.get_line())
    f_sys_prop.write('--- system properties ---\n')
    f_sys_prop.write(util.get_line())

    for line in file_buf:
        if bool_start_dump:
            f_sys_prop.write(line)

        if patt.start_sys_properties.search(line):
            bool_start_dump = True

        if patt.end_sys_properties.search(line):
            bool_start_dump = False
            break

    f_sys_prop.write(util.get_empty_line())
    f_sys_prop.close()

    # dump device info at runtime

    try:
        f_sys_prop = open(WS.file_sys_prop, 'r')
    except IOError as err:
        err_str = 'failed to read file : ' + WS.file_sys_prop + str(err)
        util.PLOGE(TAG, err_str)
        return False
    dict_devinfo = {
        'device_product_name': '',
        'device_factory_serial_num': '',
        'device_hw_serial_num': '',
        'device_build_id': '',
        'device_build_fingerprint': '',
        'device_build_date': '',
        'device_kernel_build_date': '',
        'device_kernel_build_user': '',
        'device_mpss_baseband1_build': '',
        'device_mpss_baseband_build': '',
        'device_gms_build': '',
        'device_kernel_build_user': '',
        'device_security_patch_level': '',
        'device_slot_suffix': ''
    }

    for line in f_sys_prop:
        if patt.device_product_name.search(line):
            dict_devinfo[
                'device_product_name'] = 'Device product name                 : ' + get_prop_val(
                    line)
        elif patt.device_factory_serial_num.search(line):
            dict_devinfo[
                'device_factory_serial_num'] = 'Device factory serial number        : ' + get_prop_val(
                    line)
        elif patt.device_hw_serial_num.search(line):
            dict_devinfo[
                'device_hw_serial_num'] = 'Device hardware serial number name  : ' + get_prop_val(
                    line)
        elif patt.device_build_id.search(line):
            dict_devinfo[
                'device_build_id'] = 'Device build id                     : ' + get_prop_val(
                    line)
        elif patt.device_build_fingerprint.search(line):
            dict_devinfo[
                'device_build_fingerprint'] = 'Device build fingerprint            : ' + get_prop_val(
                    line)
        elif patt.device_build_date.search(line):
            dict_devinfo[
                'device_build_date'] = 'Device build date                   : ' + get_prop_val(
                    line)
        elif patt.device_kernel_build_date.search(line):
            dict_devinfo[
                'device_kernel_build_date'] = 'Device kernel build date            : ' + get_prop_val(
                    line)
        elif patt.device_kernel_build_user.search(line):
            dict_devinfo[
                'device_kernel_build_user'] = '******' + get_prop_val(
                    line)
        elif patt.device_mpss_baseband1_build.search(line):
            dict_devinfo[
                'device_mpss_baseband1_build'] = 'Device mpss baseband1 build         : ' + get_prop_val(
                    line)
        elif patt.device_mpss_baseband_build.search(line):
            dict_devinfo[
                'device_mpss_baseband_build'] = 'Device mpss baseband build          : ' + get_prop_val(
                    line)
        elif patt.device_gms_build.search(line):
            dict_devinfo[
                'device_gms_build'] = 'Device gms build                    : ' + get_prop_val(
                    line)
        elif patt.device_kernel_build_user.search(line):
            dict_devinfo[
                'device_kernel_build_user'] = '******' + get_prop_val(
                    line)
        elif patt.device_security_patch_level.search(line):
            dict_devinfo[
                'device_security_patch_level'] = 'Device product name                 : ' + get_prop_val(
                    line)
        elif patt.device_slot_suffix.search(line):
            dict_devinfo[
                'device_slot_suffix'] = 'Device product name                 : ' + get_prop_val(
                    line)
        else:
            continue

    f_sys_prop.close()

    util.PLOGV(TAG, dict_devinfo['device_product_name'])
    util.PLOGV(TAG, dict_devinfo['device_factory_serial_num'])
    util.PLOGV(TAG, dict_devinfo['device_hw_serial_num'])
    util.PLOGV(TAG, dict_devinfo['device_build_id'])
    util.PLOGV(TAG, dict_devinfo['device_build_fingerprint'])
    util.PLOGV(TAG, dict_devinfo['device_build_date'])
    util.PLOGV(TAG, dict_devinfo['device_kernel_build_date'])
    util.PLOGV(TAG, dict_devinfo['device_kernel_build_user'])
    util.PLOGV(TAG, dict_devinfo['device_mpss_baseband1_build'])
    util.PLOGV(TAG, dict_devinfo['device_mpss_baseband_build'])
    util.PLOGV(TAG, dict_devinfo['device_gms_build'])
    util.PLOGV(TAG, dict_devinfo['device_kernel_build_user'])
    util.PLOGV(TAG, dict_devinfo['device_security_patch_level'])
    util.PLOGV(TAG, dict_devinfo['device_slot_suffix'])

    if not DumpDevinfo(WS, dict_devinfo):
        util.PLOGE(TAG, 'Failed to dump devinfo')

    return True