wowothink

thinking all the time


  • 首页

  • 归档

  • 邮件

  • 博客

  • 关于

  • 搜索

valgrind使用

发表于 2019-03-31 | 分类于 Linux 性能测试
字数统计: 1,990 | 阅读时长 ≈ 10

简介

Valgrind是构建动态分析工具的框架,Valgrind工具可以自动检测许多内存管理和线程错误,并详细介绍您的程序,还可以使用Valgrind构建新工具。

官网:http://valgrind.org/
valgrind的使用:http://valgrind.org/docs/manual/manual.html
下载地址:git clone git://sourceware.org/git/valgrind.git

阅读全文 »

Linux 性能测试工具

发表于 2019-03-31 | 分类于 Linux 性能测试
字数统计: 1,103 | 阅读时长 ≈ 6

Linux性能测试工具

在Linux Benchmark Suite Homepage网站上列举了诸多Linux性能测试工具,包括CPU/RAM/ROM/Cache/net等性能测试。
iozone工具我们在前面的文章中已经介绍和使用过了。今天,我们主要来玩一下关于RAM的读写性能测试。

阅读全文 »

u-boot启动流程

发表于 2019-03-30 | 分类于 u-boot
字数统计: 5,244 | 阅读时长 ≈ 25

以下内容根据wowo的文章进行整理学习,多数内容拷贝自wowo的文章,在适当的地方添加自己的理解,在此非常感谢wowo的大神们。

  • u-boot版本:2017.03
  • 开发板:imx8qxp mek
  • u-boot配置:未打开SPL

前言

在README文件中的Board Initialisation Flow章节有关于板级初始化流程的说明,如下:
整个u-boot的流程都按照下面的规定走:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Board Initialisation Flow:
--------------------------

This is the intended start-up flow for boards. This should apply for both
SPL and U-Boot proper (i.e. they both follow the same rules).

Note: "SPL" stands for "Secondary Program Loader," which is explained in
more detail later in this file.

At present, SPL mostly uses a separate code path, but the function names
and roles of each function are the same. Some boards or architectures
may not conform to this. At least most ARM boards which use
CONFIG_SPL_FRAMEWORK conform to this.

Execution typically starts with an architecture-specific (and possibly
CPU-specific) start.S file, such as:

- arch/arm/cpu/armv7/start.S
- arch/powerpc/cpu/mpc83xx/start.S
- arch/mips/cpu/start.S

and so on. From there, three functions are called; the purpose and
limitations of each of these functions are described below.

lowlevel_init():
- purpose: essential init to permit execution to reach board_init_f()
- no global_data or BSS
- there is no stack (ARMv7 may have one but it will soon be removed)
- must not set up SDRAM or use console
- must only do the bare minimum to allow execution to continue to
board_init_f()
- this is almost never needed
- return normally from this function

board_init_f():
- purpose: set up the machine ready for running board_init_r():
i.e. SDRAM and serial UART
- global_data is available
- stack is in SRAM
- BSS is not available, so you cannot use global/static variables,
only stack variables and global_data

Non-SPL-specific notes:
- dram_init() is called to set up DRAM. If already done in SPL this
can do nothing

SPL-specific notes:
- you can override the entire board_init_f() function with your own
version as needed.
- preloader_console_init() can be called here in extremis
- should set up SDRAM, and anything needed to make the UART work
- these is no need to clear BSS, it will be done by crt0.S
- must return normally from this function (don't call board_init_r()
directly)

Here the BSS is cleared. For SPL, if CONFIG_SPL_STACK_R is defined, then at
this point the stack and global_data are relocated to below
CONFIG_SPL_STACK_R_ADDR. For non-SPL, U-Boot is relocated to run at the top of
memory.

board_init_r():
- purpose: main execution, common code
- global_data is available
- SDRAM is available
- BSS is available, all static/global variables can be used
- execution eventually continues to main_loop()

Non-SPL-specific notes:
- U-Boot is relocated to the top of memory and is now running from
there.

SPL-specific notes:
- stack is optionally in SDRAM, if CONFIG_SPL_STACK_R is defined and
CONFIG_SPL_STACK_R_ADDR points into SDRAM
- preloader_console_init() can be called here - typically this is
done by selecting CONFIG_SPL_BOARD_INIT and then supplying a
spl_board_init() function containing this call
- loads U-Boot or (in falcon mode) Linux

阅读全文 »

Android传递宏给uboot或kernel

发表于 2018-11-12 | 分类于 Android编译相关
字数统计: 399 | 阅读时长 ≈ 2

Android编译环境,lunch的时候会进行product和variant的选择,比如说lunch xxx-eng得到的结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
victor@victor-HP:~/master$ lunch xxx-eng 

Already installed latest Toochain
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=3.0.0
TARGET_PRODUCT=xxx
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=master
============================================

因此我们可以取得几个环境变量,TARGET_BUILD_VARIANT=eng和TARGET_PRODUCT=xxx,输入env命令就可以查看当前系统当前shell下的环境变量。我们想根据TARGET_BUILD_VARIANT的值为eng或者user来选择在uboot或kernel中开关某个功能。

解决思路:
在lunch后我们可以获得TARGET_BUILD_VARIANT的值,判断其为eng或者user,然后相应的export出一个环境变量,最后在uboot或kernel中的Makefile中判断环境变量传递相应的宏。

阅读全文 »

fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot注入程序

发表于 2018-11-12 | 分类于 i.MX6
字数统计: 1,850 | 阅读时长 ≈ 10

需求

NXP release出来的mfgtools默认自带fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot文件,这个文件是mfgtools的uramdisk.img,里面自带uuc应用程序,用于进行UTP传输,可以接收ucl2.xml中指定的命令并执行。
我们需要在mfgtools烧录过程中执行某个动作,有对应的应用程序,现需要将这个应用程序打包进fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot中,以下列出2种实现方案。

阅读全文 »

RAM_ROM_SRAM_DRAM_SDRAM_FLASH

发表于 2018-11-12 | 分类于 碰到的问题
字数统计: 1,720 | 阅读时长 ≈ 6

以下内容完全参照三篇文章,特别是第一篇文章,再此表示感谢。
https://blog.csdn.net/liujiaoyage/article/details/37930475
http://www.atpinc.com/Memory-insider/computer-memory-types-dram-ram-module
https://blog.csdn.net/wbwwf8685/article/details/52724068

阅读全文 »

git-commit-template

发表于 2018-10-26 | 分类于 ubuntu工具
字数统计: 225 | 阅读时长 ≈ 1
  • 可以通过git config --global commit.template template.file来配置特定的commit log,template.file为模板。
  • 可以通过scripts/checkpatch.pl [patch or source file]来检查格式是否正确。
  • linux kernel的commit log建议使用如下模板:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Short (50 chars or less) summary of changes

    More detailed explanatory text, if necessary. Wrap it to
    about 72 characters or so. In some contexts, the first
    line is treated as the subject of an email and the rest of
    the text as the body. The blank line separating the
    summary from the body is critical (unless you omit the body
    entirely); tools like rebase can get confused if you run
    the two together.

    Further paragraphs come after blank lines.

    - Bullet points are okay, too

    - Typically a hyphen or asterisk is used for the bullet,
    preceded by a single space, with blank lines in
    between, but conventions vary here
  • 参考资料:
    如何写好 Git commit log?
    git-commit-messages-50-72-formatting
    Documentation/process/submitting-patches.rst
    提交Linux内核Patch
    像linux kernel一样管理你的项目
    A Note About Git Commit Messages

eMMC读写性能和稳定性验证

发表于 2018-10-26 | 分类于 Linux 性能测试
字数统计: 2,053 | 阅读时长 ≈ 11

本文主要讲述使用iozone、dd/cp/rm命令、fio、flashbench进行eMMC读写性能和稳定性测试。读写性能主要是通过iozone测试,稳定性主要是通过长时间随机读写进行测试。

阅读全文 »

git常用命令

发表于 2018-10-26 | 分类于 ubuntu工具
字数统计: 1,121 | 阅读时长 ≈ 5

clone某个ip地址的git仓库

1
#git clone git@192.168.1.3:knl/kernel-imx6.git

git删除未跟踪的文件

  • git clean -f: 删除 untracked files;
  • git clean -fd: 连untracked的目录也一起删掉;
  • git clean -dxf: 连gitignore的untrack文件和目录也一起删掉 (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)。

代码提交并加上commit id

1
2
3
#gitdir=$(git rev-parse --git-dir); scp -p -P 29418 user-name@192.168.1.74:hooks/commit-msg ${gitdir}/hooks/
#git commit --amend
#git push branch-name HEAD:refs/for/master
阅读全文 »

Linux常用命令

发表于 2018-10-25 | 分类于 ubuntu工具
字数统计: 1,436 | 阅读时长 ≈ 6

替换当前目录下所有字符串

在Android的开发过程中,要将Android移植到自己的平台并将所有关于Android.mk字符串重命名为Mydroid.mk。

1
# sed -i s/"Android.mk"/"Mydroid.mk"/g `grep -rl "Android.mk" ./`

首先grep当前目录下包含Android.mk字符串的文件,然后输入给sed进行替换。注意包住grep命令的是\`(TAB键上面的字符,不包括\),而不是’(单引号)。 可在grep命令后面加上–exclude_dir=".git"排除对.git/目录下文件的替换。

查看某个xxx命令的帮助

man xxx

rename批量文件操作

将Android项目中所有文件夹下名字为Androd.mk的文件重命名为Mydroid.mk。前面的是替换字符串。

1
# find ./ -name "Android.mk" | xargs rename "s/Android.mk/Mydroid.mk/g"

scp 局域网内拷贝

假设本地一份Android的source code在A(192.168.1.2)电脑上(~/work/A_Android),要将其拷贝到远程同一局域网内的B电脑(192.168.1.3 用户名为:xxx)的目录(~/work/B_Android)下:

1
# scp -r ~/work/A_Android xxx@192.168.1.3:~/work/B_Android

阅读全文 »
1…345…9
Victor Huang

Victor Huang

85 日志
21 分类
20 标签
E-Mail CSDN博客
0%
  • Android编译相关8
  • Linux Kernel10
  • Linux Kernel优化5
  • Linux USB10
  • Linux driver2
  • Linux 性能测试6
  • Python脚本2
  • QNX2
  • eMMC2
  • i.MX63
  • i.MX81
  • security1
  • security i.MX1
  • u-boot2
  • ubuntu工具11
  • 在家学习嵌入式5
  • 备忘记录1
  • 碰到的问题8
  • 网站记录1
  • 调试工具2
© 2025 Victor Huang | Site words total count: 113.3k