首页 \ 问答 \ 编译器优化是否安全?(Are compiler optimizations safe?)

编译器优化是否安全?(Are compiler optimizations safe?)

我最近在工作中发现,由于存在编译器错误的风险,我们的政策是不对硬实时嵌入式系统使用编译器优化(我们主要使用gcc,但政策也扩展到其他编译器)。 显然这个政策的开始是因为有人在过去因为优化器的错误而被烧毁。 我的直觉是,这是过度偏执所以我已经开始寻找关于这个问题的数据,但问题是我找不到任何关于此的硬数据。

有谁知道实际获得此类数据的方法? 可以使用gcc bugzilla页面生成错误与编译器优化级别的一些统计信息吗? 是否有可能获得这样的无偏​​见数据?


I recently discovered at work that it is the policy not to use compiler optimizations for hard real time embedded systems because of the risk of compiler bugs (we mainly use gcc but the policy extends to other compilers as well). Apparently this policy started because someone was burnt in the past by a bug with an optimizer. My gut feeling is that this is being overly paranoid so I've started looking for data on this issue but the problem is I can't find any hard data on this.

Does anyone know of a way to actually get this type of data? Can the gcc bugzilla page be used to generate some statistics of bugs vs compiler optimization level? Is it even possible to get unbiased data like this?


原文:https://stackoverflow.com/questions/9059265
更新时间:2023-04-01 22:04

最满意答案

这是你想要的?

Function Get-PSO($searchString) {
    # http://powershell.com/cs/blogs/tips/archive/2009/12/17/get-process-owners.aspx
    # Usage: Get-PSO * OR Get-PSO exp*,*paint*,calc*,notepad*
    # Sample Export2csv: Get-PSO notepad* | Export-CSV $env:userprofile\desktop\export.csv -Append 

    # A few date/time formats for later use... i hope
    $date=(Get-Date -format "yyyy-MM-d")
    $time=(Get-Date -format "HH:mm:ss")
    $datetime=(Get-Date -format "yyyy-MM-d HH:mm")

    $foundProcess = ps $searchString -ea silentlycontinue
    if($foundProcess -eq $null) { return; }
    $foundprocess | % {         
        gwmi Win32_Process -Filter ("Handle={0}" -f $_.id ) | 
            % { 
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Owner -Value ($_.GetOwner().User) -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Date -Value $date -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Time -Value $time -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name DateTime -Value $datetime -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Type -Value "" -PassThru
            } |
            select Name, Handle, Owner, Date, Time, DateTime, Type
    }
}

每个Add-Member命令都会为各个结果添加一个属性。 Name参数将是导出的CSV中的列名称, Value参数将是值。 select命令(实际上是Select-Object )将结果过滤到列出的属性子集。

或者,您可以使用Select-Object和Calculated Properties完成所有这些操作。

Function Get-PSO($searchString) {
    # http://powershell.com/cs/blogs/tips/archive/2009/12/17/get-process-owners.aspx
    # Usage: Get-PSO * OR Get-PSO exp*,*paint*,calc*,notepad*
    # Sample Export2csv: Get-PSO notepad* | Export-CSV $env:userprofile\desktop\export.csv -Append 

    # A few date/time formats for later use... i hope
    $date=(Get-Date -format "yyyy-MM-d")
    $time=(Get-Date -format "HH:mm:ss")
    $datetime=(Get-Date -format "yyyy-MM-d HH:mm")

    $foundProcess = ps $searchString -ea silentlycontinue
    if($foundProcess -eq $null) { return; }
    $foundprocess | % {         
        gwmi Win32_Process -Filter ("Handle={0}" -f $_.id ) | 
            select-Object Name, Handle, 
                @{Name='Owner'; Expression={$_.GetOwner().User}}, 
                @{Name='Date'; Expression={$date}}, 
                @{Name='Time'; Expression={$time}}, 
                @{Name='DateTime'; Expression={$datetime}}, 
                @{Name='Type'; Expression={''}}
    }
}

Is this what you are looking for?

Function Get-PSO($searchString) {
    # http://powershell.com/cs/blogs/tips/archive/2009/12/17/get-process-owners.aspx
    # Usage: Get-PSO * OR Get-PSO exp*,*paint*,calc*,notepad*
    # Sample Export2csv: Get-PSO notepad* | Export-CSV $env:userprofile\desktop\export.csv -Append 

    # A few date/time formats for later use... i hope
    $date=(Get-Date -format "yyyy-MM-d")
    $time=(Get-Date -format "HH:mm:ss")
    $datetime=(Get-Date -format "yyyy-MM-d HH:mm")

    $foundProcess = ps $searchString -ea silentlycontinue
    if($foundProcess -eq $null) { return; }
    $foundprocess | % {         
        gwmi Win32_Process -Filter ("Handle={0}" -f $_.id ) | 
            % { 
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Owner -Value ($_.GetOwner().User) -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Date -Value $date -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Time -Value $time -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name DateTime -Value $datetime -PassThru
                Add-Member -InputObject $_ -MemberType NoteProperty -Name Type -Value "" -PassThru
            } |
            select Name, Handle, Owner, Date, Time, DateTime, Type
    }
}

Each Add-Member command adds a property to the individual results. The Name parameter will be the column name in the exported CSV and the Value parameter will be the value. The select command (actually Select-Object) filters the results to the listed subset of properties.

Alternatively, you could do all of this using just Select-Object and Calculated Properties.

Function Get-PSO($searchString) {
    # http://powershell.com/cs/blogs/tips/archive/2009/12/17/get-process-owners.aspx
    # Usage: Get-PSO * OR Get-PSO exp*,*paint*,calc*,notepad*
    # Sample Export2csv: Get-PSO notepad* | Export-CSV $env:userprofile\desktop\export.csv -Append 

    # A few date/time formats for later use... i hope
    $date=(Get-Date -format "yyyy-MM-d")
    $time=(Get-Date -format "HH:mm:ss")
    $datetime=(Get-Date -format "yyyy-MM-d HH:mm")

    $foundProcess = ps $searchString -ea silentlycontinue
    if($foundProcess -eq $null) { return; }
    $foundprocess | % {         
        gwmi Win32_Process -Filter ("Handle={0}" -f $_.id ) | 
            select-Object Name, Handle, 
                @{Name='Owner'; Expression={$_.GetOwner().User}}, 
                @{Name='Date'; Expression={$date}}, 
                @{Name='Time'; Expression={$time}}, 
                @{Name='DateTime'; Expression={$datetime}}, 
                @{Name='Type'; Expression={''}}
    }
}

相关问答

更多
  • 我假设您使用write.table()或write.csv()将数据导出为CSV。 如果是这样,那么只需使用row.names = FALSE参数删除第一列,即行名。 I'm assuming you're using write.table() or write.csv() to export your data as a CSV. If so, then just use the row.names = FALSE argument to remove the first column which is ...
  • 作为“Generated on”字段,您可以使用点数。 有一个对象,您可以在其中设置要在导出时应用的所有选项。 它被称为exporting.chartOptions 。 在那里,您可以设置加载事件,其中将使用当前数据更新信用文本。 至于'Generated by'字段,你需要修改Chart.getSVG()函数(更多关于包装函数的信息可以在下面的DOCS参考部分找到),以便为图表SVG添加额外的文本,因为你不能有两个学分。 看看我为你准备的演示。 DOCS参考: https://www.highcharts ...
  • 在批处理中,您需要使用批处理语法。 对于Bsh使用: #!/bin/bash NOW=$(date +"%m-%d-%Y") jmeter -n -t ~/tests/TP_Login_api.jmx -Jusers=12 -Jhost=devops1 -Juser_file=users_max.csv -Jaccount=max -l /results/results_TP_Login_api_$NOW.csv -e -o/results/report/TP_Login_api 对于窗户看日期 。 ...
  • 执行以下步骤: 在查询中添加一个标准: WHERE NOT isProcessed ,因此接下来执行导出时,只会处理未处理的记录。 完成导出后,将此命令发送到数据库: "UPDATE " + tableName + " SET isProcessed=true WHERE " 。 这样,所有记录现在都标记为已处理。 包装TransactionScope arround export-mechanisme包括。 更新。 ...
  • 干得好: Sub MacroMan() ChDrive "P:" '// <~~ change current drive to P:\ Dim copyRng As Excel.Range Dim ThisWB As Excel.Workbook Dim OtherWB As Excel.Workbook Dim sName As String '// set reference to the 'Master' workbook Set ThisWB = ActiveWorkbook '// ...
  • 任何标准报告工具生成的CSV都具有平面数据结构,因此会重复所有数据集。 重新处理工具生成的XLS通常在XLS及其XLS默认行为中打开,以便为每个合并的单元格添加额外的逗号。 最好的方法是创建一个报表,其布局具有相同的数据长度列,即使是标题,即格式化报表时不要将标题放在中心,使用较大的长度,粗体和斜体等,将其作为第一列并将长度与详细记录中的数据相匹配。 这样,您就可以创建一个在XLS中看起来不可见的报表,但会在CSV中为您提供所需的数据 The CSV generated by any standard re ...
  • 假设Talend只使用SimpleDateFormat的格式模式,你想要yyyy-MM-dd 00:00:00.000 - 你现在看到的问题是D表示一年中的某一天,而不是一个月中的某一天。 这就是为什么你得到118-因为4月28日是非闰年的第118天。 在一年的开始和结束时,你也会看到问题,因为Y “周年”而不是“年”。 Assuming Talend is just using the format patterns of SimpleDateFormat, you want yyyy-MM-dd 00: ...
  • 我建议首先隐藏C和D列,然后仅从您的范围复制可见单元格。 Columns("C:D").EntireColumn.Hidden = True Sheets("MySheetNameToExport").Range("A:G").SpecialCells(xlCellTypeVisible).Copy I suggest first hiding columns C and D and then copying visible cells only from your range. Columns("C:D ...
  • 将-expandproperty参数添加到select-object cmdlet。 摘抄: $data1 = Get-Counter $counter1 $data1cooked = $data1.countersamples | Select-Object -expandproperty cookedvalue $data2 = Get-Counter $counter2 $data2cooked = $data2.countersamples | Select-Object -expandproper ...
  • 这是你想要的? Function Get-PSO($searchString) { # http://powershell.com/cs/blogs/tips/archive/2009/12/17/get-process-owners.aspx # Usage: Get-PSO * OR Get-PSO exp*,*paint*,calc*,notepad* # Sample Export2csv: Get-PSO notepad* | Export-CSV $env:userpro ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。