编译器优化是否安全?(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
最满意答案
这是你想要的?
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. TheName
parameter will be the column name in the exported CSV and theValue
parameter will be the value. Theselect
command (actuallySelect-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={''}} } }
相关问答
更多-
使用R导出CSV文件(Exporting CSV files using R)[2024-01-08]
我假设您使用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 ... -
如何在Highcharts导出器中以用户格式添加导出日期和时间?(How to add exporting date and time as user format in Highcharts exporter?)[2022-08-20]
作为“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 对于窗户看日期 。 ...
-
批量导出为CSV(Batch Exporting to CSV)[2022-10-04]
执行以下步骤: 在查询中添加一个标准: WHERE NOT isProcessed ,因此接下来执行导出时,只会处理未处理的记录。 完成导出后,将此命令发送到数据库: "UPDATE " + tableName + " SET isProcessed=true WHERE" 。 这样,所有记录现在都标记为已处理。 包装TransactionScope arround export-mechanisme包括。 更新。 ... -
将选择导出到CSV(Exporting Selection to CSV)[2023-06-02]
干得好: 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从sql server导出到csv时更改日期(Date changes while exporting from sql server to csv using talend)[2021-07-01]
假设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 ...