module GHC.Platform.Profile
( Profile (..)
, profileBuildTag
, profileConstants
, profileIsProfiling
, profileWordSizeInBytes
)
where
import GHC.Prelude
import GHC.Platform
import GHC.Platform.Ways
data Profile = Profile
{ Profile -> Platform
profilePlatform :: !Platform
, Profile -> Ways
profileWays :: !Ways
}
deriving (Profile -> Profile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Profile -> Profile -> Bool
$c/= :: Profile -> Profile -> Bool
== :: Profile -> Profile -> Bool
$c== :: Profile -> Profile -> Bool
Eq, Eq Profile
Profile -> Profile -> Bool
Profile -> Profile -> Ordering
Profile -> Profile -> Profile
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Profile -> Profile -> Profile
$cmin :: Profile -> Profile -> Profile
max :: Profile -> Profile -> Profile
$cmax :: Profile -> Profile -> Profile
>= :: Profile -> Profile -> Bool
$c>= :: Profile -> Profile -> Bool
> :: Profile -> Profile -> Bool
$c> :: Profile -> Profile -> Bool
<= :: Profile -> Profile -> Bool
$c<= :: Profile -> Profile -> Bool
< :: Profile -> Profile -> Bool
$c< :: Profile -> Profile -> Bool
compare :: Profile -> Profile -> Ordering
$ccompare :: Profile -> Profile -> Ordering
Ord, Int -> Profile -> ShowS
[Profile] -> ShowS
Profile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Profile] -> ShowS
$cshowList :: [Profile] -> ShowS
show :: Profile -> String
$cshow :: Profile -> String
showsPrec :: Int -> Profile -> ShowS
$cshowsPrec :: Int -> Profile -> ShowS
Show, ReadPrec [Profile]
ReadPrec Profile
Int -> ReadS Profile
ReadS [Profile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Profile]
$creadListPrec :: ReadPrec [Profile]
readPrec :: ReadPrec Profile
$creadPrec :: ReadPrec Profile
readList :: ReadS [Profile]
$creadList :: ReadS [Profile]
readsPrec :: Int -> ReadS Profile
$creadsPrec :: Int -> ReadS Profile
Read)
profileConstants :: Profile -> PlatformConstants
{-# INLINE profileConstants #-}
profileConstants :: Profile -> PlatformConstants
profileConstants Profile
profile = Platform -> PlatformConstants
platformConstants (Profile -> Platform
profilePlatform Profile
profile)
profileIsProfiling :: Profile -> Bool
{-# INLINE profileIsProfiling #-}
profileIsProfiling :: Profile -> Bool
profileIsProfiling Profile
profile = Profile -> Ways
profileWays Profile
profile Ways -> Way -> Bool
`hasWay` Way
WayProf
profileWordSizeInBytes :: Profile -> Int
{-# INLINE profileWordSizeInBytes #-}
profileWordSizeInBytes :: Profile -> Int
profileWordSizeInBytes Profile
profile = Platform -> Int
platformWordSizeInBytes (Profile -> Platform
profilePlatform Profile
profile)
profileBuildTag :: Profile -> String
profileBuildTag :: Profile -> String
profileBuildTag Profile
profile
| Platform -> Bool
platformUnregisterised Platform
platform = Char
'u'forall a. a -> [a] -> [a]
:String
wayTag
| Bool
otherwise = String
wayTag
where
platform :: Platform
platform = Profile -> Platform
profilePlatform Profile
profile
wayTag :: String
wayTag = Ways -> String
waysBuildTag (Profile -> Ways
profileWays Profile
profile)