当前位置: 首页 > news >正文

帮网站做关键词排名优化焦作专业网站建设费用

帮网站做关键词排名优化,焦作专业网站建设费用,51ppt模板网免费下载,做自媒体网站在Windows 11 WSL2 Ubuntu 环境下完整安装和配置perf性能分析工具 一、背景二、准备工作三、获取并编译Linux内核源码四、安装和配置perf五、测试perf六、总结 一、背景 由于WSL2使用的是微软定制的内核#xff0c;并非标准的Ubuntu内核#xff0c;因此直接使用apt安装linux… 在Windows 11 WSL2 Ubuntu 环境下完整安装和配置perf性能分析工具 一、背景二、准备工作三、获取并编译Linux内核源码四、安装和配置perf五、测试perf六、总结 一、背景 由于WSL2使用的是微软定制的内核并非标准的Ubuntu内核因此直接使用apt安装linux-tools包会失败。 sudo apt install linux-tools-common linux-tools-generic linux-tools-$(uname -r)会遇到如下错误 E: Unable to locate package linux-tools-5.15.167.4-microsoft-standard-WSL2 E: Couldnt find any package by glob linux-tools-5.15.167.4-microsoft-standard-WSL2这个时候需要手动编译安装内核代码。本文详细介绍如何在Windows 11的WSL2 (Ubuntu 22.04)环境中成功安装并配置perf性能分析工具一步步从获取内核源码到最终测试perf的完整过程并提供更全面的依赖库安装方法以确保perf功能完整。 二、准备工作 更新WSL2: 在Windows PowerShell中运行以下命令更新WSL2到最新版本 wsl --update安装必要的编译工具和依赖库: 在Ubuntu终端中执行以下命令安装编译perf所需的工具链和基础依赖库 sudo apt update sudo apt install -y bc build-essential flex bison git cmake libelf-dev这里我们预先安装了 cmake 在后续编译过程中可能会用到避免了不必要的安装错误。 三、获取并编译Linux内核源码 确定内核版本: 在Ubuntu终端中运行以下命令获取当前WSL2内核版本 uname -r输出可能类似于 5.15.167.4-microsoft-standard-WSL2我们仅提取主版本号例如 5.15.167.4。注意这个版本号可能会有变化, 你的实际操作结果跟这里的版本号可能会不同。 克隆内核源码: 使用Git克隆微软提供的WSL2内核源码。为了提高效率我们只克隆必要的代码分支 # 设置一个环境变量方便引用 export KERNEL_VERSION$(uname -r | cut -d- -f1) git clone --depth 1 --single-branch --branchlinux-msft-wsl-${KERNEL_VERSION} https://github.com/microsoft/WSL2-Linux-Kernel.git这将克隆指定版本的内核源码到 WSL2-Linux-Kernel 目录。 编译内核及perf工具: 进入克隆的目录并使用 make 命令编译内核。为了加快编译速度可以使用 -j 参数指定并行编译的进程数例如使用 -j$(nproc) 使用所有可用CPU核心进行并行编译。请注意此步骤无需root权限。 cd WSL2-Linux-Kernel make KCONFIG_CONFIGMicrosoft/config-wsl -j$(nproc)这个过程会让你输入y/n一直输入y就好。例如 ** Mitigations for CPU vulnerabilities*Mitigations for CPU vulnerabilities (CPU_MITIGATIONS) [Y/n/?] (NEW) yRemove the kernel mapping in user mode (PAGE_TABLE_ISOLATION) [Y/n/?] yAvoid speculative indirect branches in kernel (RETPOLINE) [Y/n/?] yEnable return-thunks (RETHUNK) [Y/n/?] yEnable UNRET on kernel entry (CPU_UNRET_ENTRY) [Y/n/?] yEnable IBPB on kernel entry (CPU_IBPB_ENTRY) [Y/n/?] yEnable IBRS on kernel entry (CPU_IBRS_ENTRY) [Y/n/?] yMitigate speculative RAS overflow on AMD (CPU_SRSO) [Y/n/?] yMitigate Straight-Line-Speculation (SLS) [N/y/?] nForce GDS Mitigation (GDS_FORCE_MITIGATION) [N/y/?] nRFDS Mitigation (MITIGATION_RFDS) [Y/n/?] (NEW) yMitigate Spectre-BHB (Branch History Injection) (MITIGATION_SPECTRE_BHI) [Y/n/?] (NEW) y** Core Netfilter Configuration*编译完成后进入 tools/perf 目录编译perf工具 cd tools/perf make四、安装和配置perf 安装perf: 编译完成后使用以下命令将 perf 可执行文件复制到系统目录 sudo cp perf /usr/bin/安装全功能perf的依赖库: 为了确保perf拥有全部功能需要安装额外的依赖库。这步比之前的例子更全面涵盖更多 sudo apt install binutils-dev dwarves debuginfod default-jdk default-jre libaio-dev libbabeltrace-dev libcap-dev libdw-dev libdwarf-dev libelf-dev libiberty-dev liblzma-dev libnuma-dev libperl-dev libpfm4-dev libslang2-dev libssl-dev libtraceevent-dev libunwind-dev libzstd-dev libzstd1 python3-dev python3-setuptools systemtap-sdt-dev zlib1g-dev重新编译perf (可选): 安装完所有依赖库后建议重新编译perf以确保所有功能都被启用。 make clean make编译完成后再次执行第三章节中的安装命令。编译过程中会显示哪些功能被支持。 五、测试perf 运行以下命令测试perf是否成功安装 perf --version如果成功安装将显示perf的版本信息。 perf version 5.15.167.4.g6ac7abbd97a0$ perfusage: perf [--version] [--help] [OPTIONS] COMMAND [ARGS]The most commonly used perf commands are:annotate Read perf.data (created by perf record) and display annotated codearchive Create archive with object files with build-ids found in perf.data filebench General framework for benchmark suitesbuildid-cache Manage build-id cache.buildid-list List the buildids in a perf.data filec2c Shared Data C2C/HITM Analyzer.config Get and set variables in a configuration file.daemon Run record sessions on backgrounddata Data file related processingdiff Read perf.data files and display the differential profileevlist List the event names in a perf.data fileftrace simple wrapper for kernels ftrace functionalityinject Filter to augment the events stream with additional informationiostat Show I/O performance metricskallsyms Searches running kernel for symbolskmem Tool to trace/measure kernel memory propertieskvm Tool to trace/measure kvm guest oslist List all symbolic event typeslock Analyze lock eventsmem Profile memory accessesrecord Run a command and record its profile into perf.datareport Read perf.data (created by perf record) and display the profilesched Tool to trace/measure scheduler properties (latencies)script Read perf.data (created by perf record) and display trace outputstat Run a command and gather performance counter statisticstest Runs sanity tests.timechart Tool to visualize total system behavior during a workloadtop System profiling tool.version display the version of perf binaryprobe Define new dynamic tracepointstrace strace inspired toolSee perf help COMMAND for more information on a specific command.六、总结 内核版本号可能因WSL2更新而变化请根据实际情况修改相应的版本号。编译内核是一个耗时的过程请耐心等待。确保系统具有足够的磁盘空间内核源码和编译过程会占用大量的磁盘空间。 参考 https://github.com/microsoft/WSL2-Linux-Kernelabel0b/install-linux-perf-on-wsl2.sh, https://gist.github.com/abel0b/b1881e41b9e1c4b16d84e5e083c38a13https://medium.com/manas.marwah/building-perf-tool-fc838f084f71
http://www.w-s-a.com/news/136866/

相关文章:

  • 手机购物网站 建站网站建设网站制作网站设计
  • 基于iview的网站开发模板小程序制作需要什么语言
  • 精美网站设计保定建行网站首页登录
  • 网站建设常见问题做网站保存什么格式最好
  • 营销型网站建设与网页设计网站建设 amp 找VX cp5173
  • 新网站该如何做网站优化呢儿童手工
  • 湖北现代城市建设集团网站搜索引擎优化的作用
  • 上海做网站吧开一家软件开发公司需要什么
  • 阿里巴巴网站建设改图片建设厅官方网站河南
  • 邓砚谷电子商务网站建设镇江网
  • 网站空间支持什么程序工作服款式
  • 网站单页品牌网站建设 蝌蚪5小
  • 怎么做外贸网站需注意哪些做电脑系统的网站
  • 网站建设介绍推广用语河南网站优化外包服务
  • 课程网站模板贵州省城乡与建设厅网站
  • 网站模板及源码谁家网站用户体验做的好
  • 做网站的技术要求搜索栏在wordpress菜单上位置
  • 如何给网站弄ftpwordpress怎么添加关键词描述
  • 成都工程建设信息网站金科网站建设
  • 传媒公司 网站开发厦门网站建设门户
  • 宿城区建设局网站做网站的绿色背景图
  • 网站空间托管合同 .doc网站开发团队 组建
  • 网站建设书本信息it运维服务
  • 四核网站建设设计网站流程
  • ui设计网站设计与网页制作视频教程wordpress插件漏洞利用
  • 网站建设公司排名前十做网站的最终目的
  • 选择网站开发公司的标准中国网站建设市场规模
  • 衣服网站建设策划书广州住房和城乡建设部网站
  • 微商城科技淄博网站建设优化seo
  • 杭州 网站设计制作东圃手机网站开发